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

Prefix extra columns with meta_ #794

Merged
merged 3 commits into from
Nov 16, 2023
Merged

Prefix extra columns with meta_ #794

merged 3 commits into from
Nov 16, 2023

Conversation

evetion
Copy link
Member

@evetion evetion commented Nov 16, 2023

Fixes #576

Required, but seemingly unrelated, fixes:

  • The unused, but required RootModel is generated automatically, but had the wrong casing in fieldnames, leading to errors since switching to | union (Use union types. #793) notation.
  • Utils required a Node import, leading to circular import errors when using utils elsewhere. Moved the functions to the Node class where they belong.

@evetion evetion requested a review from visr November 16, 2023 17:32
TerminalStatic: TerminalStatic | None
UserStatic: UserStatic | None
UserTime: UserTime | None
basinprofile: BasinProfile | None = None
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be basin_profile?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's unused, the whole Root is there just to generate all child models from this single root definition.json.

@visr
Copy link
Member

visr commented Nov 16, 2023

Does the prefix now get added for all dataframes?

@evetion
Copy link
Member Author

evetion commented Nov 16, 2023

Does the prefix now get added for all dataframes?

Validation always runs, also on assignment, so yes. The only exception are the node and edge tables, which have no pydantic record (cause geometry fields couldn't be autogenerated).

But feel free to test drive this.

@visr visr changed the title Prefix extra columns with meta_. Prefix extra columns with meta_ Nov 16, 2023
@visr visr merged commit 548c6eb into main Nov 16, 2023
15 checks passed
@visr visr deleted the feat/prefix-extra-columns branch November 16, 2023 20:39
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.

Allow extra table columns in Python builder
2 participants