Skip to content

Commit

Permalink
Demo of fixing plussed/plusless strings
Browse files Browse the repository at this point in the history
  • Loading branch information
joellabes committed Aug 8, 2024
1 parent 0163b4b commit 426fff5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
21 changes: 6 additions & 15 deletions schemas/latest/dbt_project-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1165,13 +1165,14 @@
"+snowflake_warehouse": {
"anyOf": [
{
"$ref": "#/$defs/SnowflakeWarehouse"
"type": "string"
},
{
"type": "null"
}
],
"default": null
"default": null,
"title": "+Snowflake Warehouse"
},
"+sql_header": {
"anyOf": [
Expand Down Expand Up @@ -1537,15 +1538,9 @@
"default": false
},
"snowflake_warehouse": {
"anyOf": [
{
"$ref": "#/$defs/SnowflakeWarehouse"
},
{
"type": "null"
}
],
"default": null
"default": "",
"title": "Snowflake Warehouse",
"type": "string"
},
"sql_header": {
"anyOf": [
Expand Down Expand Up @@ -2489,10 +2484,6 @@
"title": "SnapshotConfigs",
"type": "object"
},
"SnowflakeWarehouse": {
"title": "SnowflakeWarehouse",
"type": "string"
},
"SourceConfigs": {
"properties": {
"+enabled": {
Expand Down
9 changes: 2 additions & 7 deletions src/latest/dbt_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,6 @@ class Severity1(Enum):
class Severity(RootModel[Union[JinjaString, Severity1]]):
root: Union[JinjaString, Severity1]


class SnowflakeWarehouse(RootModel[str]):
root: str


class SqlHeader(RootModel[str]):
root: str

Expand Down Expand Up @@ -474,7 +469,7 @@ class ModelConfigs(BaseModel):
field_pre_hook: Optional[ArrayOfStrings] = Field(None, alias='+pre-hook')
field_schema: Optional[Schema] = Field(None, alias='+schema')
field_secure: Optional[BooleanOrJinjaString] = Field(False, alias='+secure')
field_snowflake_warehouse: Optional[SnowflakeWarehouse] = Field(
field_snowflake_warehouse: Optional[str] = Field(
None, alias='+snowflake_warehouse'
)
field_sql_header: Optional[SqlHeader] = Field(None, alias='+sql_header')
Expand Down Expand Up @@ -510,7 +505,7 @@ class ModelConfigs(BaseModel):
pre_hook: Optional[ArrayOfStrings] = Field(None, alias='pre-hook')
schema_: Optional[Schema] = Field(None, alias='schema')
secure: Optional[BooleanOrJinjaString] = False
snowflake_warehouse: Optional[SnowflakeWarehouse] = None
snowflake_warehouse: str = ""
sql_header: Optional[SqlHeader] = None
tags: Optional[Tags] = None
target_lag: Optional[TargetLag] = None
Expand Down

0 comments on commit 426fff5

Please sign in to comment.