Skip to content
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

734 fix dataset schema #762

Merged
merged 3 commits into from
Jun 12, 2019
Merged

Conversation

simon-contreras-deel
Copy link
Contributor

Fix #734

  • the schema should be None in a dataset without context (local data) not public
  • set the dataset context implies having a new schema

@simon-contreras-deel simon-contreras-deel requested review from alrocar, Jesus89 and andy-esch and removed request for alrocar and Jesus89 June 11, 2019 14:39
if context:
self.cc = context
self.schema = context.get_default_schema()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user has already a schema and he calls the upload function with a different one, the original is modified. Is this the expected behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have said in the description setting the dataset context implies having a new schema

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean:
new context == new api key and new username
So if we have a new username (or the same), we have to update the schema.

Using a different schema is needed to use data from users from your organization and I can not see a situation of conflict with this approach

Copy link
Contributor Author

@simon-contreras-deel simon-contreras-deel Jun 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have only changed it here because it is the only place updating the context. In develop we will need to do it in the context setter method

else:
return 'public'

return None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This return None is not required

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but I want to be explicit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like redundant and explicit return Nones :)

Copy link
Contributor

@andy-esch andy-esch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about @Jesus89's comment https://github.com/CartoDB/cartoframes/pull/762/files#r292501862, otherwise I think it looks good

@simon-contreras-deel
Copy link
Contributor Author

Green?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants