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

Feat: Support top level properties in model_defaults #3696

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

themisvaltinos
Copy link
Contributor

@themisvaltinos themisvaltinos commented Jan 23, 2025

This update extends the support for top-level properties to be enabled project wide, fixes: #3599

  • when both project-wide and model-specific properties are defined, they are combined.
  • if a property is set at the model level, it takes precedence over the project-wide setting.
  • if a user wants to unset a project-wide property on a specific model, they can do so by explicitly setting it to None.

Don't know if it makes sense to include more, as the others seem quite model-specific, but I’m happy to add them if anyone feels they’re necessary.

Copy link
Contributor

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

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

LGTM, just one comment.

session_properties[k] = exp.Literal.string(k).eq(v)
if k not in properties:
properties[k] = exp.Literal.string(k).eq(v)
elif properties[k].expression.sql().lower() in {"none", "null"}:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is matching null here safe? Can that be an actual property value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to match for python models properties where None will be null here

@themisvaltinos themisvaltinos requested a review from a team January 29, 2025 16:45
@themisvaltinos themisvaltinos merged commit 98954b1 into main Jan 30, 2025
21 checks passed
@themisvaltinos themisvaltinos deleted the themis/model_defaults branch January 30, 2025 06:38
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.

Support all top-level properties in model_defaults
3 participants