Skip to content

Commit 6c3ad39

Browse files
authored
Merge branch 'main' into fix/sqlmesh-stale-cache-file-not-found
2 parents a0744af + 8f092ac commit 6c3ad39

File tree

7 files changed

+36
-9
lines changed

7 files changed

+36
-9
lines changed

docs/guides/vscode.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
The SQLMesh Visual Studio Code extension is in preview and undergoing active development. You may encounter bugs or API incompatibilities with the SQLMesh version you are running.
88

9-
We encourage you to try the extension and [create Github issues](https://github.com/tobikodata/sqlmesh/issues) for any problems you encounter.
9+
We encourage you to try the extension and [create Github issues](https://github.com/SQLMesh/sqlmesh/issues) for any problems you encounter.
1010

1111
In this guide, you'll set up the SQLMesh extension in the Visual Studio Code IDE software (which we refer to as "VSCode").
1212

@@ -187,7 +187,7 @@ The most common problem is the extension not using the correct Python interprete
187187

188188
Follow the [setup process described above](#vscode-python-interpreter) to ensure that the extension is using the correct Python interpreter.
189189

190-
If you have checked the VSCode `sqlmesh` output channel and the extension is still not using the correct Python interpreter, please raise an issue [here](https://github.com/tobikodata/sqlmesh/issues).
190+
If you have checked the VSCode `sqlmesh` output channel and the extension is still not using the correct Python interpreter, please raise an issue [here](https://github.com/SQLMesh/sqlmesh/issues).
191191

192192
### Missing Python dependencies
193193

@@ -205,4 +205,4 @@ If you are using Tobiko Cloud, make sure `lsp` is included in the list of extras
205205

206206
While the SQLMesh VSCode extension is in preview and the APIs to the underlying SQLMesh version are not stable, we do not guarantee compatibility between the extension and the SQLMesh version you are using.
207207

208-
If you encounter a problem, please raise an issue [here](https://github.com/tobikodata/sqlmesh/issues).
208+
If you encounter a problem, please raise an issue [here](https://github.com/SQLMesh/sqlmesh/issues).

sqlmesh/core/config/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ class BigQueryConnectionConfig(ConnectionConfig):
10621062
job_retry_deadline_seconds: t.Optional[int] = None
10631063
priority: t.Optional[BigQueryPriority] = None
10641064
maximum_bytes_billed: t.Optional[int] = None
1065+
reservation: t.Optional[str] = None
10651066

10661067
concurrent_tasks: int = 1
10671068
register_comments: bool = True
@@ -1171,6 +1172,7 @@ def _extra_engine_config(self) -> t.Dict[str, t.Any]:
11711172
"job_retry_deadline_seconds",
11721173
"priority",
11731174
"maximum_bytes_billed",
1175+
"reservation",
11741176
}
11751177
}
11761178

sqlmesh/core/engine_adapter/bigquery.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,10 @@ def _job_params(self) -> t.Dict[str, t.Any]:
140140
"priority", BigQueryPriority.INTERACTIVE.bigquery_constant
141141
),
142142
}
143-
if self._extra_config.get("maximum_bytes_billed"):
143+
if self._extra_config.get("maximum_bytes_billed") is not None:
144144
params["maximum_bytes_billed"] = self._extra_config.get("maximum_bytes_billed")
145+
if self._extra_config.get("reservation") is not None:
146+
params["reservation"] = self._extra_config.get("reservation")
145147
if self.correlation_id:
146148
# BigQuery label keys must be lowercase
147149
key = self.correlation_id.job_type.value.lower()
@@ -1106,7 +1108,9 @@ def _execute(
11061108
else []
11071109
)
11081110

1111+
# Create job config
11091112
job_config = QueryJobConfig(**self._job_params, connection_properties=connection_properties)
1113+
11101114
self._query_job = self._db_call(
11111115
self.client.query,
11121116
query=sql,

tests/cli/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1949,7 +1949,7 @@ def test_init_dbt_template(runner: CliRunner, tmp_path: Path):
19491949
def test_init_project_engine_configs(tmp_path):
19501950
engine_type_to_config = {
19511951
"redshift": "# concurrent_tasks: 4\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # user: \n # password: \n # database: \n # host: \n # port: \n # source_address: \n # unix_sock: \n # ssl: \n # sslmode: \n # timeout: \n # tcp_keepalive: \n # application_name: \n # preferred_role: \n # principal_arn: \n # credentials_provider: \n # region: \n # cluster_identifier: \n # iam: \n # is_serverless: \n # serverless_acct_id: \n # serverless_work_group: \n # enable_merge: ",
1952-
"bigquery": "# concurrent_tasks: 1\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # method: oauth\n # project: \n # execution_project: \n # quota_project: \n # location: \n # keyfile: \n # keyfile_json: \n # token: \n # refresh_token: \n # client_id: \n # client_secret: \n # token_uri: \n # scopes: \n # impersonated_service_account: \n # job_creation_timeout_seconds: \n # job_execution_timeout_seconds: \n # job_retries: 1\n # job_retry_deadline_seconds: \n # priority: \n # maximum_bytes_billed: ",
1952+
"bigquery": "# concurrent_tasks: 1\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # method: oauth\n # project: \n # execution_project: \n # quota_project: \n # location: \n # keyfile: \n # keyfile_json: \n # token: \n # refresh_token: \n # client_id: \n # client_secret: \n # token_uri: \n # scopes: \n # impersonated_service_account: \n # job_creation_timeout_seconds: \n # job_execution_timeout_seconds: \n # job_retries: 1\n # job_retry_deadline_seconds: \n # priority: \n # maximum_bytes_billed: \n # reservation: ",
19531953
"snowflake": "account: \n # concurrent_tasks: 4\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # user: \n # password: \n # warehouse: \n # database: \n # role: \n # authenticator: \n # token: \n # host: \n # port: \n # application: Tobiko_SQLMesh\n # private_key: \n # private_key_path: \n # private_key_passphrase: \n # session_parameters: ",
19541954
"databricks": "# concurrent_tasks: 1\n # register_comments: True\n # pre_ping: False\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # server_hostname: \n # http_path: \n # access_token: \n # auth_type: \n # oauth_client_id: \n # oauth_client_secret: \n # catalog: \n # http_headers: \n # session_configuration: \n # databricks_connect_server_hostname: \n # databricks_connect_access_token: \n # databricks_connect_cluster_id: \n # databricks_connect_use_serverless: False\n # force_databricks_connect: False\n # disable_databricks_connect: False\n # disable_spark_session: False",
19551955
"postgres": "host: \n user: \n password: \n port: \n database: \n # concurrent_tasks: 4\n # register_comments: True\n # pre_ping: True\n # pretty_sql: False\n # schema_differ_overrides: \n # catalog_type_overrides: \n # keepalives_idle: \n # connect_timeout: 10\n # role: \n # sslmode: \n # application_name: ",

tests/core/test_connection_config.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,27 @@ def test_bigquery(make_config):
11311131
assert config.get_catalog() == "project"
11321132
assert config.is_recommended_for_state_sync is False
11331133

1134+
# Test reservation
1135+
config_with_reservation = make_config(
1136+
type="bigquery",
1137+
project="project",
1138+
reservation="projects/my-project/locations/us-central1/reservations/my-reservation",
1139+
check_import=False,
1140+
)
1141+
assert isinstance(config_with_reservation, BigQueryConnectionConfig)
1142+
assert (
1143+
config_with_reservation.reservation
1144+
== "projects/my-project/locations/us-central1/reservations/my-reservation"
1145+
)
1146+
1147+
# Test that reservation is included in _extra_engine_config
1148+
extra_config = config_with_reservation._extra_engine_config
1149+
assert "reservation" in extra_config
1150+
assert (
1151+
extra_config["reservation"]
1152+
== "projects/my-project/locations/us-central1/reservations/my-reservation"
1153+
)
1154+
11341155
with pytest.raises(ConfigError, match="you must also specify the `project` field"):
11351156
make_config(type="bigquery", execution_project="execution_project", check_import=False)
11361157

vscode/extension/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ If you encounter issues, please refer to the [VSCode Extension Guide](https://sq
7777

7878
We welcome contributions! Please:
7979

80-
1. [Report bugs](https://github.com/tobikodata/sqlmesh/issues) you encounter
81-
2. [Request features](https://github.com/tobikodata/sqlmesh/issues) you'd like to see
80+
1. [Report bugs](https://github.com/SQLMesh/sqlmesh/issues) you encounter
81+
2. [Request features](https://github.com/SQLMesh/sqlmesh/issues) you'd like to see
8282
3. Share feedback on your experience
8383

8484
## 📄 License
@@ -87,7 +87,7 @@ This extension is licensed under the Apache License 2.0. See [LICENSE](LICENSE)
8787

8888
## 🔗 Links
8989

90-
- [SQLMesh GitHub Repository](https://github.com/tobikodata/sqlmesh)
90+
- [SQLMesh GitHub Repository](https://github.com/SQLMesh/sqlmesh)
9191
- [Tobiko Data Website](https://tobikodata.com)
9292
- [Extension Marketplace Page](https://marketplace.visualstudio.com/items?itemName=tobikodata.sqlmesh)
9393

vscode/extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"version": "0.0.7",
77
"repository": {
88
"type": "git",
9-
"url": "https://github.com/tobikodata/sqlmesh"
9+
"url": "https://github.com/SQLMesh/sqlmesh"
1010
},
1111
"main": "./dist/extension.js",
1212
"icon": "assets/logo.png",

0 commit comments

Comments
 (0)