Uh oh!
There was an error while loading. Please reload this page.
Cleanup and fixes - #69
Conversation
abdelhai
commented
May 17, 2022
hi @LemonPi314 thanks for the great PR! |
lemonyte
commented
May 17, 2022
I would be happy to do that, or if you prefer I could open a new PR. Any in particular you want me to take a look at? |
abdelhai
commented
May 17, 2022
@LemonPi314 thanks for the quick response! i feel all are worth taking a look at, you could help us decide which ones we should consider merging. one new monolithic PR would be awesome! i'm assuming this/the new pr will be breaking and we'll have to release a major version. rn, maybe we could group that with async support... what do you think? |
lemonyte
commented
May 17, 2022
abdelhai
commented
May 17, 2022
i believe yours already does as you're raising a |
lemonyte
commented
May 17, 2022
That is true. In that case it may be worth changing the package behavior slightly as described in my original comment since it is a breaking change as well. |
lemonyte
commented
May 18, 2022
A few questions:
|
abdelhai
commented
May 19, 2022
the reason behind the # this is the original apifromdetaimportDetadeta=Deta(<mykey/futureconfig>)
users=deta.Base("users")
photos=deta.Drive("photos")
# this is just a convenience api that works on Micros OR if the project key is set in the environmentfromdetaimportBase, Driveusers=Base("users")
photos=Drive("photos")We can require devs to put the project key in the env, but what happens if we need more config?
is this the pythonic way of doing it? haven't touch python code for a while.
you are right, let's keep async separate. i need to think about the api design |
lemonyte
commented
May 19, 2022
abdelhai
commented
May 23, 2022
thanks for the clarification! I'm not seeing the benefit from |
lemonyte
commented
May 30, 2022
Update:
|
lemonyte
commented
May 30, 2022
@abdelhai it seems the checks are failing due to missing project keys. Can you check the workflow secrets? |


Cleaned up and formatted the code, also fixed a couple broken tests.
Changes:
type()check withisinstance()checkasserts in main package code with proper exceptions.format()calls with f-strings since they are already used in other placeshostparameter toBase()andDrive()functions not in theDetaclassCONTRIBUTING.mdtest_ttltestDETA_SDK_TEST_TTL_ATTRIBUTEtoenv.sampleas seen in the pull request workflowblack -l 100(same as Clean-Up #48)What is the purpose of the
Detaclass in__init__.py? It doesn't seem to accomplish anything new that isn't already available when using the module directly, other than setting the project key and id manually. It's a little confusing having two almost identical sets of methods. Perhaps a better solution would be to have aninit()function to manually set the project key and id.