Skip to content

Commit 0c3e751

Browse files
committed
rename file_systems to filesystems
1 parent a411e33 commit 0c3e751

6 files changed

Lines changed: 19 additions & 19 deletions

File tree

docs/integrations/engines/duckdb.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
| `extensions` | Extension to load into duckdb. Only autoloadable extensions are supported. | list | N |
1919
| `connector_config` | Configuration to pass into the duckdb connector. | dict | N |
2020
| `secrets` | Configuration for authenticating external sources (e.g., S3) using DuckDB secrets. | dict | N |
21-
| `file_systems` | Configuration for registering `fsspec` filesystems to the DuckDB connection. secrets. | dict | N |
21+
| `filesystems` | Configuration for registering `fsspec` filesystems to the DuckDB connection. | dict | N |
2222

2323
#### DuckDB Catalogs Example
2424

@@ -261,7 +261,7 @@ Refer to the official DuckDB documentation for the full list of [supported S3 se
261261
262262
##### File system configuration example for Microsoft Onelake
263263

264-
The `file_systems` accepts a list of file systems to register in the DuckDB connection. This is especially useful for Azure Storage Accounts, as it adds write support for DuckDB which is not natively supported by DuckDB (yet).
264+
The `filesystems` accepts a list of file systems to register in the DuckDB connection. This is especially useful for Azure Storage Accounts, as it adds write support for DuckDB which is not natively supported by DuckDB (yet).
265265

266266

267267
=== "YAML"
@@ -278,7 +278,7 @@ The `file_systems` accepts a list of file systems to register in the DuckDB conn
278278
data_path: abfs://MyFabricWorkspace/MyFabricLakehouse.Lakehouse/Files/DuckLake.Files
279279
extensions:
280280
- ducklake
281-
file_systems:
281+
filesystems:
282282
- protocol: abfs
283283
storage_options:
284284
account_name: onelake

sqlmesh/core/config/connection.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class BaseDuckDBConnectionConfig(ConnectionConfig):
266266
extensions: A list of autoloadable extensions to load.
267267
connector_config: A dictionary of configuration to pass into the duckdb connector.
268268
secrets: A list of dictionaries used to generate DuckDB secrets for authenticating with external services (e.g. S3).
269-
file_systems: A list of dictionaries used to register `fsspec` filesystems to the DuckDB cursor.
269+
filesystems: A list of dictionaries used to register `fsspec` filesystems to the DuckDB cursor.
270270
concurrent_tasks: The maximum number of tasks that can use this connection concurrently.
271271
register_comments: Whether or not to register model comments with the SQL engine.
272272
pre_ping: Whether or not to pre-ping the connection before starting a new transaction to ensure it is still alive.
@@ -278,7 +278,7 @@ class BaseDuckDBConnectionConfig(ConnectionConfig):
278278
extensions: t.List[t.Union[str, t.Dict[str, t.Any]]] = []
279279
connector_config: t.Dict[str, t.Any] = {}
280280
secrets: t.List[t.Dict[str, t.Any]] = []
281-
file_systems: t.List[t.Dict[str, t.Any]] = []
281+
filesystems: t.List[t.Dict[str, t.Any]] = []
282282

283283
concurrent_tasks: int = 1
284284
register_comments: bool = True
@@ -373,10 +373,10 @@ def init(cursor: duckdb.DuckDBPyConnection) -> None:
373373
except Exception as e:
374374
raise ConfigError(f"Failed to create secret: {e}")
375375

376-
if self.file_systems:
376+
if self.filesystems:
377377
from fsspec import filesystem # type: ignore
378378

379-
for file_system in self.file_systems:
379+
for file_system in self.filesystems:
380380
protocol = file_system.pop("protocol")
381381
storage_options = file_system.pop("storage_options")
382382
fs = filesystem(protocol, **storage_options)

sqlmesh/dbt/target.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class DuckDbConfig(TargetConfig):
138138
extensions: A list of autoloadable extensions to load.
139139
settings: A dictionary of settings to pass into the duckdb connector.
140140
secrets: A list of secrets to pass to the secret manager in the duckdb connector.
141-
file_systems: A list of `fsspec` filesystems to register in the duckdb connection.
141+
filesystems: A list of `fsspec` filesystems to register in the duckdb connection.
142142
"""
143143

144144
type: t.Literal["duckdb"] = "duckdb"
@@ -148,7 +148,7 @@ class DuckDbConfig(TargetConfig):
148148
extensions: t.Optional[t.List[str]] = None
149149
settings: t.Optional[t.Dict[str, t.Any]] = None
150150
secrets: t.Optional[t.List[t.Dict[str, t.Any]]] = None
151-
file_systems: t.Optional[t.List[t.Dict[str, t.Any]]] = None
151+
filesystems: t.Optional[t.List[t.Dict[str, t.Any]]] = None
152152

153153
@model_validator(mode="before")
154154
def validate_authentication(cls, data: t.Any) -> t.Any:
@@ -184,8 +184,8 @@ def to_sqlmesh(self, **kwargs: t.Any) -> ConnectionConfig:
184184
kwargs["connector_config"] = self.settings
185185
if self.secrets is not None:
186186
kwargs["secrets"] = self.secrets
187-
if self.file_systems is not None:
188-
kwargs["file_systems"] = self.file_systems
187+
if self.filesystems is not None:
188+
kwargs["filesystems"] = self.filesystems
189189
return DuckDBConnectionConfig(
190190
database=self.path,
191191
concurrent_tasks=1,

tests/core/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ def test_connection_config_serialization():
562562
"pretty_sql": False,
563563
"connector_config": {},
564564
"secrets": [],
565-
"file_systems": [],
565+
"filesystems": [],
566566
"database": "my_db",
567567
}
568568
assert serialized["default_test_connection"] == {
@@ -574,7 +574,7 @@ def test_connection_config_serialization():
574574
"pretty_sql": False,
575575
"connector_config": {},
576576
"secrets": [],
577-
"file_systems": [],
577+
"filesystems": [],
578578
"database": "my_test_db",
579579
}
580580

tests/core/test_connection_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ def test_duckdb(make_config):
437437
"secret": "aws_secret",
438438
}
439439
],
440-
file_systems=[
440+
filesystems=[
441441
{
442442
"protocol": "abfs",
443443
"storage_options": {
@@ -450,7 +450,7 @@ def test_duckdb(make_config):
450450
)
451451
assert config.connector_config
452452
assert config.secrets
453-
assert config.file_systems
453+
assert config.filesystems
454454
assert isinstance(config, DuckDBConnectionConfig)
455455
assert not config.is_recommended_for_state_sync
456456

tests/integrations/jupyter/test_magics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,16 +745,16 @@ def test_info(notebook, sushi_context, convert_all_html_output_to_text, get_all_
745745
"Models: 20",
746746
"Macros: 8",
747747
"",
748-
"Connection:\n type: duckdb\n concurrent_tasks: 1\n register_comments: true\n pre_ping: false\n pretty_sql: false\n extensions: []\n connector_config: {}\n secrets: None\n file_systems: []",
749-
"Test Connection:\n type: duckdb\n concurrent_tasks: 1\n register_comments: true\n pre_ping: false\n pretty_sql: false\n extensions: []\n connector_config: {}\n secrets: None\n file_systems: []",
748+
"Connection:\n type: duckdb\n concurrent_tasks: 1\n register_comments: true\n pre_ping: false\n pretty_sql: false\n extensions: []\n connector_config: {}\n secrets: None\n filesystems: []",
749+
"Test Connection:\n type: duckdb\n concurrent_tasks: 1\n register_comments: true\n pre_ping: false\n pretty_sql: false\n extensions: []\n connector_config: {}\n secrets: None\n filesystems: []",
750750
"Data warehouse connection succeeded",
751751
]
752752
assert get_all_html_output(output) == [
753753
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Models: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">20</span></pre>",
754754
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Macros: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">8</span></pre>",
755755
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>",
756-
'<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,\'DejaVu Sans Mono\',consolas,\'Courier New\',monospace">Connection: type: duckdb concurrent_tasks: <span style="color: #008080; text-decoration-color: #008080; font-weight: bold">1</span> register_comments: true pre_ping: false pretty_sql: false extensions: <span style="font-weight: bold">[]</span> connector_config: <span style="font-weight: bold">{}</span> secrets: <span style="color: #800080; text-decoration-color: #800080; font-style: italic">None</span> file_systems: <span style="font-weight: bold">[]</span></pre>',
757-
'<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,\'DejaVu Sans Mono\',consolas,\'Courier New\',monospace">Test Connection: type: duckdb concurrent_tasks: <span style="color: #008080; text-decoration-color: #008080; font-weight: bold">1</span> register_comments: true pre_ping: false pretty_sql: false extensions: <span style="font-weight: bold">[]</span> connector_config: <span style="font-weight: bold">{}</span> secrets: <span style="color: #800080; text-decoration-color: #800080; font-style: italic">None</span> file_systems: <span style="font-weight: bold">[]</span></pre>',
756+
'<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,\'DejaVu Sans Mono\',consolas,\'Courier New\',monospace">Connection: type: duckdb concurrent_tasks: <span style="color: #008080; text-decoration-color: #008080; font-weight: bold">1</span> register_comments: true pre_ping: false pretty_sql: false extensions: <span style="font-weight: bold">[]</span> connector_config: <span style="font-weight: bold">{}</span> secrets: <span style="color: #800080; text-decoration-color: #800080; font-style: italic">None</span> filesystems: <span style="font-weight: bold">[]</span></pre>',
757+
'<pre style="white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,\'DejaVu Sans Mono\',consolas,\'Courier New\',monospace">Test Connection: type: duckdb concurrent_tasks: <span style="color: #008080; text-decoration-color: #008080; font-weight: bold">1</span> register_comments: true pre_ping: false pretty_sql: false extensions: <span style="font-weight: bold">[]</span> connector_config: <span style="font-weight: bold">{}</span> secrets: <span style="color: #800080; text-decoration-color: #800080; font-style: italic">None</span> filesystems: <span style="font-weight: bold">[]</span></pre>',
758758
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Data warehouse connection <span style=\"color: #008000; text-decoration-color: #008000\">succeeded</span></pre>",
759759
]
760760

0 commit comments

Comments
 (0)