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

Add Table model, save all table references to metadata.tables, re… #51

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

surister
Copy link
Collaborator

@surister surister commented Jul 3, 2024

…move table_name and schema from metadata.

Fixes #50

Checklist

  • Link to issue this PR refers to (if applicable):
  • CLA is signed

@surister
Copy link
Collaborator Author

surister commented Jul 3, 2024

Apparently return f'{quote(self.schema) + '.' if self.schema else ""}{quote(self.name)}' is not valid in Python 3.8, don't even remember why, will check it tomorrow since I want to have dinner :P Still good to review.

Copy link
Member

@amotl amotl left a comment

Choose a reason for hiding this comment

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

Excellent, thanks!

cratedb_sqlparse_py/cratedb_sqlparse/models.py Outdated Show resolved Hide resolved
@@ -132,8 +132,7 @@ class Metadata:
table, schema, columns, options...
"""

schema: str = None
table_name: str = None
tables: list = dataclasses.field(default_factory=list)
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion to use typing.List, in order to stay compatible with Python 3.8.

Suggested change
tables: list = dataclasses.field(default_factory=list)
tables: List[Table] = dataclasses.field(default_factory=list)

…les`, remove `table_name` and `schema` from metadata.
@surister surister merged commit 8178bc6 into crate:main Jul 4, 2024
5 checks passed
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.

Only latest table name is saved
2 participants