-
Notifications
You must be signed in to change notification settings - Fork 26
Cleanup and fixes #69
base: next
Are you sure you want to change the base?
Conversation
hi @LemonPi314 thanks for the great PR! |
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? |
@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? |
i believe yours already does as you're raising a |
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. |
A few questions:
|
the reason behind the # this is the original api
from deta import Deta
deta = Deta(<my key/future config>)
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 environment
from deta import Base, Drive
users = 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 |
thanks for the clarification! I'm not seeing the benefit from |
Update:
|
@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()
checkassert
s in main package code with proper exceptions.format()
calls with f-strings since they are already used in other placeshost
parameter toBase()
andDrive()
functions not in theDeta
classCONTRIBUTING.md
test_ttl
testDETA_SDK_TEST_TTL_ATTRIBUTE
toenv.sample
as seen in the pull request workflowblack -l 100
(same as Clean-Up #48)What is the purpose of the
Deta
class 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.