-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean old API #871
Clean old API #871
Conversation
@@ -122,6 +121,10 @@ def set_default_credentials( | |||
_default_credentials.session = session | |||
|
|||
|
|||
def _is_url(text): | |||
return re.match(r'^https?://.*$', text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the user enters http://username.carto.com
? This will return False, but is that still a valid URL for API calls? If so, should we coerce it to https
or give a warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http
should work, because of the ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works, I checked it the first time I saw it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Should we coerce to https
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure. base_url
is used mainly by onpremises, right? In this case, I suppose we shouldn't require https
. What do you see it?
cartoframes/examples.py
Outdated
@@ -110,7 +111,7 @@ class Examples(Context): | |||
""" | |||
|
|||
def __init__(self): | |||
super(Examples, self).__init__( | |||
set_default_credentials( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use self._credentials = Credentials(... instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 🔥 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Just the change in the Example class about using scoped credentials instead of setting the default ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Solves #807 & #624
I have created a table file in data namespace to include the tables method from context