snowlib 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {snowlib-0.4.2 → snowlib-0.4.3}/PKG-INFO +1 -1
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/__init__.py +1 -1
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/stage.py +21 -2
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib.egg-info/PKG-INFO +1 -1
- {snowlib-0.4.2 → snowlib-0.4.3}/LICENSE +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/README.md +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/licenses/THIRD_PARTY.md +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/pyproject.toml +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/setup.cfg +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/_data/connections.toml.example +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/_data/test_config.toml.example +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/connection/__init__.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/connection/base.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/connection/connection.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/connection/paths.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/connection/profiles.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/context.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/__init__.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/base/__init__.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/base/core.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/base/fqn.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/base/schema_child.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/base/show.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/column.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/database.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/schema.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/table/__init__.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/table/base.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/table/dynamic_table.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/table/materialized_view.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/table/table.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/models/table/view.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/primitives/__init__.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/primitives/async_query.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/primitives/execute.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/primitives/result.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/py.typed +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/session.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/sqlalchemy.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/utils/identifiers.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/utils/json_columns.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/utils/query.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib/utils/schema.py +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib.egg-info/SOURCES.txt +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib.egg-info/dependency_links.txt +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib.egg-info/requires.txt +0 -0
- {snowlib-0.4.2 → snowlib-0.4.3}/src/snowlib.egg-info/top_level.txt +0 -0
|
@@ -127,10 +127,29 @@ class Stage(SchemaChild):
|
|
|
127
127
|
auto_compress: bool = True,
|
|
128
128
|
overwrite: bool = False,
|
|
129
129
|
show_progress: bool = True,
|
|
130
|
+
prefix: Optional[str] = None,
|
|
130
131
|
) -> list[dict[str, Any]]:
|
|
131
|
-
"""Upload local files to the stage with progress bar
|
|
132
|
+
"""Upload local files to the stage with progress bar
|
|
133
|
+
|
|
134
|
+
Args:
|
|
135
|
+
files: List of local file paths to upload
|
|
136
|
+
auto_compress: Whether to automatically compress files during upload
|
|
137
|
+
overwrite: Whether to overwrite existing files in the stage
|
|
138
|
+
show_progress: Whether to show progress bar (requires tqdm)
|
|
139
|
+
prefix: Optional subdirectory path within the stage (e.g., 'courses', 'data/2024')
|
|
140
|
+
|
|
141
|
+
Returns:
|
|
142
|
+
List of dicts with upload results for each file
|
|
143
|
+
"""
|
|
132
144
|
results = []
|
|
133
145
|
|
|
146
|
+
# Build target path with optional prefix
|
|
147
|
+
target_path = self.stage_path
|
|
148
|
+
if prefix:
|
|
149
|
+
# Normalize prefix (strip leading/trailing slashes)
|
|
150
|
+
prefix = prefix.strip('/')
|
|
151
|
+
target_path = f"{self.stage_path}/{prefix}"
|
|
152
|
+
|
|
134
153
|
iterator = tqdm(files, desc="Uploading") if (show_progress and HAS_TQDM and tqdm is not None) else files
|
|
135
154
|
|
|
136
155
|
for file_path in iterator:
|
|
@@ -142,7 +161,7 @@ class Stage(SchemaChild):
|
|
|
142
161
|
})
|
|
143
162
|
continue
|
|
144
163
|
|
|
145
|
-
sql = f"PUT 'file://{file_path.as_posix()}' {
|
|
164
|
+
sql = f"PUT 'file://{file_path.as_posix()}' {target_path}"
|
|
146
165
|
sql += f" AUTO_COMPRESS = {str(auto_compress).upper()}"
|
|
147
166
|
sql += f" OVERWRITE = {str(overwrite).upper()}"
|
|
148
167
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|