Conversation
sqlmesh/core/config/connection.py
Outdated
| role: t.Optional[str] = None | ||
| authenticator: t.Optional[str] = None | ||
| token: t.Optional[str] = None | ||
| application: str = 'Tobiko_SQLMesh' |
There was a problem hiding this comment.
this shouldn’t be configurable
There was a problem hiding this comment.
made it a property
There was a problem hiding this comment.
Nevermind, made it a classvar instead. Let me know if you want more protection on it.
sqlmesh/core/config/connection.py
Outdated
| role: t.Optional[str] = None | ||
| authenticator: t.Optional[str] = None | ||
| token: t.Optional[str] = None | ||
| application: t.ClassVar[str] = "Tobiko_SQLMesh" |
There was a problem hiding this comment.
I think doing t.Literal["Tobiko_SQLMesh"] = "Tobiko_SQLMesh" is more common in the codebase, but not sure if t.ClassVar semantics match the use case better.
Does this guard from the field being mutated, though? Perhaps we should add it to _FIELD_UPDATE_STRATEGY with the IMMUTABLE strategy? cc @tobymao
There was a problem hiding this comment.
I'll assume Iaroslav's 👍 means it's worth changing this.
There was a problem hiding this comment.
I chose a ClassVar because it'll raise this error if you try to mutate on an instance of a class:
AttributeError: 'application' is a ClassVar of `SnowflakeConnectionConfig` and cannot be set on an instance. If you want to set a value on the class, use `SnowflakeConnectionConfig.application = value`.
…t/snowflake-tracking
See how people are using SQLMesh with Snowflake. Should look and feel like this in the query history.
