Skip to content

Commit ddeba25

Browse files
committed
Fixing format issues
1 parent 9889ae6 commit ddeba25

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

contrib/templates/file-push/template/{{.catalog_name}}.{{.schema_name}}/src/utils/envmanager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def get_config() -> dict:
1616
return configs
1717

1818

19-
def has_default_storage(catalog_name: str, workspace_client: WorkspaceClient = None) -> bool:
19+
def has_default_storage(
20+
catalog_name: str, workspace_client: WorkspaceClient = None
21+
) -> bool:
2022
w = workspace_client or WorkspaceClient()
2123

2224
# Try SDK model first

contrib/templates/file-push/template/{{.catalog_name}}.{{.schema_name}}/src/utils/formatmanager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ def __init__(self):
131131
# Cache the supported formats so they are only created on the first call
132132
_supported_formats_cache = {}
133133

134+
134135
def get_supported_formats() -> dict[str, AutoLoaderFormat]:
135136
if not _supported_formats_cache:
136-
_supported_formats_cache.update({
137-
f.name: f for f in (CSV(), JSON(), AVRO(), PARQUET())
138-
})
137+
_supported_formats_cache.update(
138+
{f.name: f for f in (CSV(), JSON(), AVRO(), PARQUET())}
139+
)
139140
return _supported_formats_cache
140141

141142

contrib/templates/file-push/template/{{.catalog_name}}.{{.schema_name}}/src/utils/tablemanager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ def validate_config(table_config: dict):
1515
raise ValueError("name is required for table config")
1616
if not table_config.get("format"):
1717
raise ValueError("format is required for table config")
18-
18+
1919
# Validate table name characters (Databricks naming convention)
2020
table_name = table_config.get("name")
21-
if not re.match(r'^[a-z0-9_-]+$', table_name):
21+
if not re.match(r"^[a-z0-9_-]+$", table_name):
2222
raise ValueError(
2323
f"Table name '{table_name}' contains unsupported characters. "
2424
"Table names must only consist of lowercase letters, numbers, underscores, and dashes."
2525
)
26-
26+
2727
# Validate format is supported
2828
fmt = table_config.get("format")
2929
try:
3030
fmt_mgr = formatmanager.get_format_manager(fmt)
3131
except ValueError as e:
3232
raise ValueError(f"Unsupported format for table '{table_name}': {e}")
33-
33+
3434
# Validate format options (check for blocklisted/hidden options)
3535
format_options = table_config.get("format_options", {})
3636
if format_options:

0 commit comments

Comments
 (0)