sqlspec 0.47.0__cp314-cp314-win_amd64.whl
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.
- f68e0789eb443ecb1c2c__mypyc.cp314-win_amd64.pyd +0 -0
- sqlspec/__init__.py +167 -0
- sqlspec/__main__.py +12 -0
- sqlspec/__metadata__.py +14 -0
- sqlspec/_typing.py +714 -0
- sqlspec/adapters/__init__.py +0 -0
- sqlspec/adapters/adbc/__init__.py +13 -0
- sqlspec/adapters/adbc/_typing.py +106 -0
- sqlspec/adapters/adbc/adk/__init__.py +5 -0
- sqlspec/adapters/adbc/adk/store.py +1280 -0
- sqlspec/adapters/adbc/config.py +378 -0
- sqlspec/adapters/adbc/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/adbc/core.py +922 -0
- sqlspec/adapters/adbc/data_dictionary.py +339 -0
- sqlspec/adapters/adbc/driver.py +534 -0
- sqlspec/adapters/adbc/events/__init__.py +5 -0
- sqlspec/adapters/adbc/events/store.py +285 -0
- sqlspec/adapters/adbc/litestar/__init__.py +5 -0
- sqlspec/adapters/adbc/litestar/store.py +534 -0
- sqlspec/adapters/adbc/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/adbc/type_converter.py +142 -0
- sqlspec/adapters/aiomysql/__init__.py +21 -0
- sqlspec/adapters/aiomysql/_typing.py +137 -0
- sqlspec/adapters/aiomysql/adk/__init__.py +5 -0
- sqlspec/adapters/aiomysql/adk/store.py +678 -0
- sqlspec/adapters/aiomysql/config.py +305 -0
- sqlspec/adapters/aiomysql/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/aiomysql/core.py +536 -0
- sqlspec/adapters/aiomysql/data_dictionary.py +121 -0
- sqlspec/adapters/aiomysql/driver.py +386 -0
- sqlspec/adapters/aiomysql/events/__init__.py +5 -0
- sqlspec/adapters/aiomysql/events/store.py +104 -0
- sqlspec/adapters/aiomysql/litestar/__init__.py +5 -0
- sqlspec/adapters/aiomysql/litestar/store.py +314 -0
- sqlspec/adapters/aiosqlite/__init__.py +26 -0
- sqlspec/adapters/aiosqlite/_typing.py +109 -0
- sqlspec/adapters/aiosqlite/adk/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/adk/store.py +829 -0
- sqlspec/adapters/aiosqlite/config.py +315 -0
- sqlspec/adapters/aiosqlite/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/aiosqlite/core.py +315 -0
- sqlspec/adapters/aiosqlite/data_dictionary.py +202 -0
- sqlspec/adapters/aiosqlite/driver.py +311 -0
- sqlspec/adapters/aiosqlite/events/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/events/store.py +20 -0
- sqlspec/adapters/aiosqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/aiosqlite/litestar/store.py +279 -0
- sqlspec/adapters/aiosqlite/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/aiosqlite/pool.py +734 -0
- sqlspec/adapters/asyncmy/__init__.py +21 -0
- sqlspec/adapters/asyncmy/_typing.py +113 -0
- sqlspec/adapters/asyncmy/adk/__init__.py +5 -0
- sqlspec/adapters/asyncmy/adk/store.py +644 -0
- sqlspec/adapters/asyncmy/config.py +307 -0
- sqlspec/adapters/asyncmy/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/asyncmy/core.py +538 -0
- sqlspec/adapters/asyncmy/data_dictionary.py +122 -0
- sqlspec/adapters/asyncmy/driver.py +391 -0
- sqlspec/adapters/asyncmy/events/__init__.py +5 -0
- sqlspec/adapters/asyncmy/events/store.py +104 -0
- sqlspec/adapters/asyncmy/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncmy/litestar/store.py +296 -0
- sqlspec/adapters/asyncpg/__init__.py +26 -0
- sqlspec/adapters/asyncpg/_typing.py +103 -0
- sqlspec/adapters/asyncpg/adk/__init__.py +5 -0
- sqlspec/adapters/asyncpg/adk/store.py +483 -0
- sqlspec/adapters/asyncpg/config.py +575 -0
- sqlspec/adapters/asyncpg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/asyncpg/core.py +480 -0
- sqlspec/adapters/asyncpg/data_dictionary.py +157 -0
- sqlspec/adapters/asyncpg/driver.py +487 -0
- sqlspec/adapters/asyncpg/events/__init__.py +6 -0
- sqlspec/adapters/asyncpg/events/_hub.py +181 -0
- sqlspec/adapters/asyncpg/events/backend.py +210 -0
- sqlspec/adapters/asyncpg/events/store.py +40 -0
- sqlspec/adapters/asyncpg/litestar/__init__.py +5 -0
- sqlspec/adapters/asyncpg/litestar/store.py +251 -0
- sqlspec/adapters/bigquery/__init__.py +15 -0
- sqlspec/adapters/bigquery/_typing.py +108 -0
- sqlspec/adapters/bigquery/config.py +362 -0
- sqlspec/adapters/bigquery/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/bigquery/core.py +768 -0
- sqlspec/adapters/bigquery/data_dictionary.py +120 -0
- sqlspec/adapters/bigquery/driver.py +542 -0
- sqlspec/adapters/bigquery/events/__init__.py +5 -0
- sqlspec/adapters/bigquery/events/store.py +139 -0
- sqlspec/adapters/bigquery/litestar/__init__.py +5 -0
- sqlspec/adapters/bigquery/litestar/store.py +325 -0
- sqlspec/adapters/bigquery/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/bigquery/type_converter.py +107 -0
- sqlspec/adapters/cockroach_asyncpg/__init__.py +26 -0
- sqlspec/adapters/cockroach_asyncpg/_typing.py +73 -0
- sqlspec/adapters/cockroach_asyncpg/adk/__init__.py +3 -0
- sqlspec/adapters/cockroach_asyncpg/adk/store.py +465 -0
- sqlspec/adapters/cockroach_asyncpg/config.py +248 -0
- sqlspec/adapters/cockroach_asyncpg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/cockroach_asyncpg/core.py +55 -0
- sqlspec/adapters/cockroach_asyncpg/data_dictionary.py +110 -0
- sqlspec/adapters/cockroach_asyncpg/driver.py +142 -0
- sqlspec/adapters/cockroach_asyncpg/events/__init__.py +3 -0
- sqlspec/adapters/cockroach_asyncpg/events/store.py +20 -0
- sqlspec/adapters/cockroach_asyncpg/litestar/__init__.py +3 -0
- sqlspec/adapters/cockroach_asyncpg/litestar/store.py +142 -0
- sqlspec/adapters/cockroach_psycopg/__init__.py +39 -0
- sqlspec/adapters/cockroach_psycopg/_typing.py +137 -0
- sqlspec/adapters/cockroach_psycopg/adk/__init__.py +13 -0
- sqlspec/adapters/cockroach_psycopg/adk/store.py +1039 -0
- sqlspec/adapters/cockroach_psycopg/config.py +511 -0
- sqlspec/adapters/cockroach_psycopg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/cockroach_psycopg/core.py +63 -0
- sqlspec/adapters/cockroach_psycopg/data_dictionary.py +220 -0
- sqlspec/adapters/cockroach_psycopg/driver.py +273 -0
- sqlspec/adapters/cockroach_psycopg/events/__init__.py +6 -0
- sqlspec/adapters/cockroach_psycopg/events/store.py +34 -0
- sqlspec/adapters/cockroach_psycopg/litestar/__init__.py +3 -0
- sqlspec/adapters/cockroach_psycopg/litestar/store.py +327 -0
- sqlspec/adapters/duckdb/__init__.py +29 -0
- sqlspec/adapters/duckdb/_typing.py +104 -0
- sqlspec/adapters/duckdb/adk/__init__.py +14 -0
- sqlspec/adapters/duckdb/adk/store.py +935 -0
- sqlspec/adapters/duckdb/config.py +386 -0
- sqlspec/adapters/duckdb/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/duckdb/core.py +332 -0
- sqlspec/adapters/duckdb/data_dictionary.py +140 -0
- sqlspec/adapters/duckdb/driver.py +426 -0
- sqlspec/adapters/duckdb/events/__init__.py +5 -0
- sqlspec/adapters/duckdb/events/store.py +57 -0
- sqlspec/adapters/duckdb/litestar/__init__.py +5 -0
- sqlspec/adapters/duckdb/litestar/store.py +330 -0
- sqlspec/adapters/duckdb/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/duckdb/pool.py +350 -0
- sqlspec/adapters/duckdb/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/duckdb/type_converter.py +118 -0
- sqlspec/adapters/mysqlconnector/__init__.py +39 -0
- sqlspec/adapters/mysqlconnector/_typing.py +186 -0
- sqlspec/adapters/mysqlconnector/adk/__init__.py +15 -0
- sqlspec/adapters/mysqlconnector/adk/store.py +1183 -0
- sqlspec/adapters/mysqlconnector/config.py +421 -0
- sqlspec/adapters/mysqlconnector/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/mysqlconnector/core.py +472 -0
- sqlspec/adapters/mysqlconnector/data_dictionary.py +230 -0
- sqlspec/adapters/mysqlconnector/driver.py +516 -0
- sqlspec/adapters/mysqlconnector/events/__init__.py +8 -0
- sqlspec/adapters/mysqlconnector/events/store.py +98 -0
- sqlspec/adapters/mysqlconnector/litestar/__init__.py +5 -0
- sqlspec/adapters/mysqlconnector/litestar/store.py +426 -0
- sqlspec/adapters/oracledb/__init__.py +39 -0
- sqlspec/adapters/oracledb/_json_handlers.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_json_handlers.py +196 -0
- sqlspec/adapters/oracledb/_param_types.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_param_types.py +46 -0
- sqlspec/adapters/oracledb/_typing.py +258 -0
- sqlspec/adapters/oracledb/_uuid_handlers.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_uuid_handlers.py +163 -0
- sqlspec/adapters/oracledb/_vector_handlers.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/_vector_handlers.py +228 -0
- sqlspec/adapters/oracledb/adk/__init__.py +21 -0
- sqlspec/adapters/oracledb/adk/store.py +2453 -0
- sqlspec/adapters/oracledb/config.py +575 -0
- sqlspec/adapters/oracledb/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/core.py +820 -0
- sqlspec/adapters/oracledb/data_dictionary.py +404 -0
- sqlspec/adapters/oracledb/driver.py +1277 -0
- sqlspec/adapters/oracledb/events/__init__.py +16 -0
- sqlspec/adapters/oracledb/events/_hub.py +345 -0
- sqlspec/adapters/oracledb/events/backend.py +300 -0
- sqlspec/adapters/oracledb/events/store.py +420 -0
- sqlspec/adapters/oracledb/litestar/__init__.py +5 -0
- sqlspec/adapters/oracledb/litestar/store.py +781 -0
- sqlspec/adapters/oracledb/migrations.py +539 -0
- sqlspec/adapters/oracledb/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/oracledb/type_converter.py +211 -0
- sqlspec/adapters/psqlpy/__init__.py +18 -0
- sqlspec/adapters/psqlpy/_typing.py +121 -0
- sqlspec/adapters/psqlpy/adk/__init__.py +5 -0
- sqlspec/adapters/psqlpy/adk/store.py +591 -0
- sqlspec/adapters/psqlpy/config.py +376 -0
- sqlspec/adapters/psqlpy/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psqlpy/core.py +694 -0
- sqlspec/adapters/psqlpy/data_dictionary.py +121 -0
- sqlspec/adapters/psqlpy/driver.py +411 -0
- sqlspec/adapters/psqlpy/events/__init__.py +6 -0
- sqlspec/adapters/psqlpy/events/_hub.py +204 -0
- sqlspec/adapters/psqlpy/events/backend.py +210 -0
- sqlspec/adapters/psqlpy/events/store.py +20 -0
- sqlspec/adapters/psqlpy/litestar/__init__.py +5 -0
- sqlspec/adapters/psqlpy/litestar/store.py +270 -0
- sqlspec/adapters/psqlpy/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psqlpy/type_converter.py +113 -0
- sqlspec/adapters/psycopg/__init__.py +38 -0
- sqlspec/adapters/psycopg/_typing.py +218 -0
- sqlspec/adapters/psycopg/adk/__init__.py +10 -0
- sqlspec/adapters/psycopg/adk/store.py +1106 -0
- sqlspec/adapters/psycopg/config.py +695 -0
- sqlspec/adapters/psycopg/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psycopg/core.py +520 -0
- sqlspec/adapters/psycopg/data_dictionary.py +278 -0
- sqlspec/adapters/psycopg/driver.py +1033 -0
- sqlspec/adapters/psycopg/events/__init__.py +20 -0
- sqlspec/adapters/psycopg/events/_hub.py +388 -0
- sqlspec/adapters/psycopg/events/backend.py +398 -0
- sqlspec/adapters/psycopg/events/store.py +42 -0
- sqlspec/adapters/psycopg/litestar/__init__.py +5 -0
- sqlspec/adapters/psycopg/litestar/store.py +554 -0
- sqlspec/adapters/psycopg/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/psycopg/type_converter.py +93 -0
- sqlspec/adapters/pymysql/__init__.py +21 -0
- sqlspec/adapters/pymysql/_typing.py +92 -0
- sqlspec/adapters/pymysql/adk/__init__.py +5 -0
- sqlspec/adapters/pymysql/adk/store.py +657 -0
- sqlspec/adapters/pymysql/config.py +176 -0
- sqlspec/adapters/pymysql/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/pymysql/core.py +469 -0
- sqlspec/adapters/pymysql/data_dictionary.py +120 -0
- sqlspec/adapters/pymysql/driver.py +271 -0
- sqlspec/adapters/pymysql/events/__init__.py +5 -0
- sqlspec/adapters/pymysql/events/store.py +50 -0
- sqlspec/adapters/pymysql/litestar/__init__.py +5 -0
- sqlspec/adapters/pymysql/litestar/store.py +232 -0
- sqlspec/adapters/pymysql/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/pymysql/pool.py +184 -0
- sqlspec/adapters/spanner/__init__.py +33 -0
- sqlspec/adapters/spanner/_typing.py +102 -0
- sqlspec/adapters/spanner/adk/__init__.py +5 -0
- sqlspec/adapters/spanner/adk/store.py +758 -0
- sqlspec/adapters/spanner/config.py +355 -0
- sqlspec/adapters/spanner/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/spanner/core.py +263 -0
- sqlspec/adapters/spanner/data_dictionary.py +120 -0
- sqlspec/adapters/spanner/driver.py +407 -0
- sqlspec/adapters/spanner/events/__init__.py +5 -0
- sqlspec/adapters/spanner/events/store.py +187 -0
- sqlspec/adapters/spanner/litestar/__init__.py +5 -0
- sqlspec/adapters/spanner/litestar/store.py +291 -0
- sqlspec/adapters/spanner/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/spanner/type_converter.py +342 -0
- sqlspec/adapters/sqlite/__init__.py +19 -0
- sqlspec/adapters/sqlite/_typing.py +123 -0
- sqlspec/adapters/sqlite/adk/__init__.py +5 -0
- sqlspec/adapters/sqlite/adk/store.py +992 -0
- sqlspec/adapters/sqlite/config.py +240 -0
- sqlspec/adapters/sqlite/core.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/sqlite/core.py +357 -0
- sqlspec/adapters/sqlite/data_dictionary.py +198 -0
- sqlspec/adapters/sqlite/driver.py +527 -0
- sqlspec/adapters/sqlite/events/__init__.py +5 -0
- sqlspec/adapters/sqlite/events/store.py +20 -0
- sqlspec/adapters/sqlite/litestar/__init__.py +5 -0
- sqlspec/adapters/sqlite/litestar/store.py +316 -0
- sqlspec/adapters/sqlite/pool.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/sqlite/pool.py +237 -0
- sqlspec/adapters/sqlite/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/adapters/sqlite/type_converter.py +114 -0
- sqlspec/base.py +832 -0
- sqlspec/builder/__init__.py +181 -0
- sqlspec/builder/_base.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_base.py +1071 -0
- sqlspec/builder/_column.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_column.py +521 -0
- sqlspec/builder/_ddl.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_ddl.py +1691 -0
- sqlspec/builder/_delete.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_delete.py +95 -0
- sqlspec/builder/_dml.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_dml.py +386 -0
- sqlspec/builder/_explain.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_explain.py +579 -0
- sqlspec/builder/_expression_wrappers.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_expression_wrappers.py +46 -0
- sqlspec/builder/_factory.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_factory.py +1884 -0
- sqlspec/builder/_insert.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_insert.py +405 -0
- sqlspec/builder/_join.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_join.py +489 -0
- sqlspec/builder/_merge.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_merge.py +823 -0
- sqlspec/builder/_parsing_utils.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_parsing_utils.py +295 -0
- sqlspec/builder/_select.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_select.py +1666 -0
- sqlspec/builder/_temporal.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_temporal.py +167 -0
- sqlspec/builder/_update.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_update.py +173 -0
- sqlspec/builder/_vector_distance.cp314-win_amd64.pyd +0 -0
- sqlspec/builder/_vector_distance.py +330 -0
- sqlspec/cli.py +1095 -0
- sqlspec/config.py +2383 -0
- sqlspec/core/__init__.py +372 -0
- sqlspec/core/_correlation.cp314-win_amd64.pyd +0 -0
- sqlspec/core/_correlation.py +176 -0
- sqlspec/core/_pagination.py +42 -0
- sqlspec/core/_pool.cp314-win_amd64.pyd +0 -0
- sqlspec/core/_pool.py +76 -0
- sqlspec/core/cache.cp314-win_amd64.pyd +0 -0
- sqlspec/core/cache.py +1085 -0
- sqlspec/core/compiler.cp314-win_amd64.pyd +0 -0
- sqlspec/core/compiler.py +1090 -0
- sqlspec/core/config_runtime.cp314-win_amd64.pyd +0 -0
- sqlspec/core/config_runtime.py +174 -0
- sqlspec/core/explain.cp314-win_amd64.pyd +0 -0
- sqlspec/core/explain.py +275 -0
- sqlspec/core/filters.cp314-win_amd64.pyd +0 -0
- sqlspec/core/filters.py +969 -0
- sqlspec/core/hashing.cp314-win_amd64.pyd +0 -0
- sqlspec/core/hashing.py +266 -0
- sqlspec/core/metrics.cp314-win_amd64.pyd +0 -0
- sqlspec/core/metrics.py +83 -0
- sqlspec/core/parameters/__init__.py +72 -0
- sqlspec/core/parameters/_alignment.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_alignment.py +283 -0
- sqlspec/core/parameters/_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_converter.py +554 -0
- sqlspec/core/parameters/_processor.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_processor.py +1182 -0
- sqlspec/core/parameters/_registry.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_registry.py +206 -0
- sqlspec/core/parameters/_transformers.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_transformers.py +324 -0
- sqlspec/core/parameters/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_types.py +536 -0
- sqlspec/core/parameters/_validator.cp314-win_amd64.pyd +0 -0
- sqlspec/core/parameters/_validator.py +171 -0
- sqlspec/core/pipeline.cp314-win_amd64.pyd +0 -0
- sqlspec/core/pipeline.py +333 -0
- sqlspec/core/query_modifiers.cp314-win_amd64.pyd +0 -0
- sqlspec/core/query_modifiers.py +508 -0
- sqlspec/core/result/__init__.py +25 -0
- sqlspec/core/result/_base.cp314-win_amd64.pyd +0 -0
- sqlspec/core/result/_base.py +1232 -0
- sqlspec/core/result/_io.cp314-win_amd64.pyd +0 -0
- sqlspec/core/result/_io.py +28 -0
- sqlspec/core/splitter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/splitter.py +1021 -0
- sqlspec/core/sqlcommenter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/sqlcommenter.py +249 -0
- sqlspec/core/stack.cp314-win_amd64.pyd +0 -0
- sqlspec/core/stack.py +163 -0
- sqlspec/core/statement.cp314-win_amd64.pyd +0 -0
- sqlspec/core/statement.py +1865 -0
- sqlspec/core/type_converter.cp314-win_amd64.pyd +0 -0
- sqlspec/core/type_converter.py +340 -0
- sqlspec/data_dictionary/__init__.py +22 -0
- sqlspec/data_dictionary/_loader.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/_loader.py +138 -0
- sqlspec/data_dictionary/_registry.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/_registry.py +74 -0
- sqlspec/data_dictionary/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/_types.py +121 -0
- sqlspec/data_dictionary/dialects/__init__.py +21 -0
- sqlspec/data_dictionary/dialects/bigquery.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/bigquery.py +81 -0
- sqlspec/data_dictionary/dialects/cockroachdb.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/cockroachdb.py +54 -0
- sqlspec/data_dictionary/dialects/duckdb.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/duckdb.py +47 -0
- sqlspec/data_dictionary/dialects/mysql.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/mysql.py +53 -0
- sqlspec/data_dictionary/dialects/oracle.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/oracle.py +197 -0
- sqlspec/data_dictionary/dialects/postgres.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/postgres.py +69 -0
- sqlspec/data_dictionary/dialects/spanner.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/spanner.py +37 -0
- sqlspec/data_dictionary/dialects/sqlite.cp314-win_amd64.pyd +0 -0
- sqlspec/data_dictionary/dialects/sqlite.py +59 -0
- sqlspec/data_dictionary/sql/.gitkeep +0 -0
- sqlspec/data_dictionary/sql/bigquery/columns.sql +23 -0
- sqlspec/data_dictionary/sql/bigquery/foreign_keys.sql +34 -0
- sqlspec/data_dictionary/sql/bigquery/indexes.sql +19 -0
- sqlspec/data_dictionary/sql/bigquery/tables.sql +33 -0
- sqlspec/data_dictionary/sql/bigquery/version.sql +3 -0
- sqlspec/data_dictionary/sql/cockroachdb/columns.sql +34 -0
- sqlspec/data_dictionary/sql/cockroachdb/foreign_keys.sql +40 -0
- sqlspec/data_dictionary/sql/cockroachdb/indexes.sql +32 -0
- sqlspec/data_dictionary/sql/cockroachdb/tables.sql +44 -0
- sqlspec/data_dictionary/sql/cockroachdb/version.sql +3 -0
- sqlspec/data_dictionary/sql/duckdb/columns.sql +23 -0
- sqlspec/data_dictionary/sql/duckdb/foreign_keys.sql +36 -0
- sqlspec/data_dictionary/sql/duckdb/indexes.sql +19 -0
- sqlspec/data_dictionary/sql/duckdb/tables.sql +38 -0
- sqlspec/data_dictionary/sql/duckdb/version.sql +3 -0
- sqlspec/data_dictionary/sql/mysql/columns.sql +23 -0
- sqlspec/data_dictionary/sql/mysql/foreign_keys.sql +28 -0
- sqlspec/data_dictionary/sql/mysql/indexes.sql +26 -0
- sqlspec/data_dictionary/sql/mysql/tables.sql +33 -0
- sqlspec/data_dictionary/sql/mysql/version.sql +3 -0
- sqlspec/data_dictionary/sql/oracle/columns.sql +23 -0
- sqlspec/data_dictionary/sql/oracle/foreign_keys.sql +48 -0
- sqlspec/data_dictionary/sql/oracle/indexes.sql +44 -0
- sqlspec/data_dictionary/sql/oracle/tables.sql +25 -0
- sqlspec/data_dictionary/sql/oracle/version.sql +20 -0
- sqlspec/data_dictionary/sql/postgres/columns.sql +34 -0
- sqlspec/data_dictionary/sql/postgres/foreign_keys.sql +40 -0
- sqlspec/data_dictionary/sql/postgres/indexes.sql +56 -0
- sqlspec/data_dictionary/sql/postgres/tables.sql +44 -0
- sqlspec/data_dictionary/sql/postgres/version.sql +3 -0
- sqlspec/data_dictionary/sql/spanner/columns.sql +23 -0
- sqlspec/data_dictionary/sql/spanner/foreign_keys.sql +70 -0
- sqlspec/data_dictionary/sql/spanner/indexes.sql +30 -0
- sqlspec/data_dictionary/sql/spanner/tables.sql +9 -0
- sqlspec/data_dictionary/sql/spanner/version.sql +3 -0
- sqlspec/data_dictionary/sql/sqlite/columns.sql +23 -0
- sqlspec/data_dictionary/sql/sqlite/foreign_keys.sql +22 -0
- sqlspec/data_dictionary/sql/sqlite/indexes.sql +7 -0
- sqlspec/data_dictionary/sql/sqlite/tables.sql +28 -0
- sqlspec/data_dictionary/sql/sqlite/version.sql +3 -0
- sqlspec/dialects/__init__.py +22 -0
- sqlspec/dialects/_compat.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/_compat.py +14 -0
- sqlspec/dialects/postgres/__init__.py +9 -0
- sqlspec/dialects/postgres/_generators.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/postgres/_generators.py +57 -0
- sqlspec/dialects/postgres/_operators.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/postgres/_operators.py +81 -0
- sqlspec/dialects/postgres/_paradedb.py +50 -0
- sqlspec/dialects/postgres/_pgvector.py +36 -0
- sqlspec/dialects/spanner/__init__.py +6 -0
- sqlspec/dialects/spanner/_generators.cp314-win_amd64.pyd +0 -0
- sqlspec/dialects/spanner/_generators.py +206 -0
- sqlspec/dialects/spanner/_spangres.py +77 -0
- sqlspec/dialects/spanner/_spanner.py +179 -0
- sqlspec/driver/__init__.py +49 -0
- sqlspec/driver/_async.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_async.py +1830 -0
- sqlspec/driver/_common.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_common.py +2292 -0
- sqlspec/driver/_exception_handler.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_exception_handler.py +108 -0
- sqlspec/driver/_query_cache.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_query_cache.py +96 -0
- sqlspec/driver/_sql_helpers.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_sql_helpers.py +139 -0
- sqlspec/driver/_storage_helpers.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_storage_helpers.py +153 -0
- sqlspec/driver/_sync.cp314-win_amd64.pyd +0 -0
- sqlspec/driver/_sync.py +1817 -0
- sqlspec/exceptions.cp314-win_amd64.pyd +0 -0
- sqlspec/exceptions.py +480 -0
- sqlspec/extensions/__init__.py +0 -0
- sqlspec/extensions/adk/__init__.py +84 -0
- sqlspec/extensions/adk/_config_utils.py +199 -0
- sqlspec/extensions/adk/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/adk/_types.py +41 -0
- sqlspec/extensions/adk/artifact/__init__.py +57 -0
- sqlspec/extensions/adk/artifact/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/adk/artifact/_types.py +32 -0
- sqlspec/extensions/adk/artifact/service.py +508 -0
- sqlspec/extensions/adk/artifact/store.py +361 -0
- sqlspec/extensions/adk/converters.py +212 -0
- sqlspec/extensions/adk/memory/__init__.py +69 -0
- sqlspec/extensions/adk/memory/_types.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/adk/memory/_types.py +30 -0
- sqlspec/extensions/adk/memory/converters.py +225 -0
- sqlspec/extensions/adk/memory/service.py +316 -0
- sqlspec/extensions/adk/memory/store.py +525 -0
- sqlspec/extensions/adk/migrations/0001_create_adk_tables.py +184 -0
- sqlspec/extensions/adk/migrations/__init__.py +0 -0
- sqlspec/extensions/adk/service.py +279 -0
- sqlspec/extensions/adk/store.py +590 -0
- sqlspec/extensions/events/__init__.py +51 -0
- sqlspec/extensions/events/_channel.py +703 -0
- sqlspec/extensions/events/_hints.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/events/_hints.py +45 -0
- sqlspec/extensions/events/_models.py +23 -0
- sqlspec/extensions/events/_payload.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/events/_payload.py +69 -0
- sqlspec/extensions/events/_protocols.py +134 -0
- sqlspec/extensions/events/_queue.py +462 -0
- sqlspec/extensions/events/_store.py +209 -0
- sqlspec/extensions/events/migrations/0001_create_event_queue.py +59 -0
- sqlspec/extensions/events/migrations/__init__.py +3 -0
- sqlspec/extensions/fastapi/__init__.py +22 -0
- sqlspec/extensions/fastapi/extension.py +391 -0
- sqlspec/extensions/fastapi/providers.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/fastapi/providers.py +712 -0
- sqlspec/extensions/flask/__init__.py +38 -0
- sqlspec/extensions/flask/_state.py +87 -0
- sqlspec/extensions/flask/_utils.py +71 -0
- sqlspec/extensions/flask/extension.py +539 -0
- sqlspec/extensions/litestar/__init__.py +31 -0
- sqlspec/extensions/litestar/_utils.py +52 -0
- sqlspec/extensions/litestar/channels.py +165 -0
- sqlspec/extensions/litestar/cli.py +102 -0
- sqlspec/extensions/litestar/config.py +90 -0
- sqlspec/extensions/litestar/handlers.py +316 -0
- sqlspec/extensions/litestar/migrations/0001_create_session_table.py +137 -0
- sqlspec/extensions/litestar/migrations/__init__.py +3 -0
- sqlspec/extensions/litestar/plugin.py +1066 -0
- sqlspec/extensions/litestar/providers.cp314-win_amd64.pyd +0 -0
- sqlspec/extensions/litestar/providers.py +784 -0
- sqlspec/extensions/litestar/store.py +298 -0
- sqlspec/extensions/otel/__init__.py +58 -0
- sqlspec/extensions/prometheus/__init__.py +113 -0
- sqlspec/extensions/sanic/__init__.py +19 -0
- sqlspec/extensions/sanic/_state.py +43 -0
- sqlspec/extensions/sanic/_utils.py +127 -0
- sqlspec/extensions/sanic/extension.py +647 -0
- sqlspec/extensions/starlette/__init__.py +22 -0
- sqlspec/extensions/starlette/_state.py +42 -0
- sqlspec/extensions/starlette/_utils.py +96 -0
- sqlspec/extensions/starlette/extension.py +374 -0
- sqlspec/extensions/starlette/middleware.py +281 -0
- sqlspec/loader.cp314-win_amd64.pyd +0 -0
- sqlspec/loader.py +727 -0
- sqlspec/migrations/__init__.py +39 -0
- sqlspec/migrations/base.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/base.py +862 -0
- sqlspec/migrations/commands.py +2151 -0
- sqlspec/migrations/context.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/context.py +157 -0
- sqlspec/migrations/fix.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/fix.py +204 -0
- sqlspec/migrations/loaders.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/loaders.py +443 -0
- sqlspec/migrations/runner.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/runner.py +1195 -0
- sqlspec/migrations/squash.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/squash.py +490 -0
- sqlspec/migrations/templates.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/templates.py +234 -0
- sqlspec/migrations/tracker.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/tracker.py +792 -0
- sqlspec/migrations/utils.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/utils.py +256 -0
- sqlspec/migrations/validation.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/validation.py +359 -0
- sqlspec/migrations/version.cp314-win_amd64.pyd +0 -0
- sqlspec/migrations/version.py +446 -0
- sqlspec/observability/__init__.py +57 -0
- sqlspec/observability/_common.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_common.py +77 -0
- sqlspec/observability/_config.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_config.py +364 -0
- sqlspec/observability/_diagnostics.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_diagnostics.py +74 -0
- sqlspec/observability/_dispatcher.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_dispatcher.py +200 -0
- sqlspec/observability/_formatters/__init__.py +13 -0
- sqlspec/observability/_formatters/_aws.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_aws.py +102 -0
- sqlspec/observability/_formatters/_azure.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_azure.py +96 -0
- sqlspec/observability/_formatters/_base.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_base.py +57 -0
- sqlspec/observability/_formatters/_gcp.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_formatters/_gcp.py +131 -0
- sqlspec/observability/_formatting.py +58 -0
- sqlspec/observability/_observer.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_observer.py +361 -0
- sqlspec/observability/_runtime.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_runtime.py +461 -0
- sqlspec/observability/_sampling.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_sampling.py +188 -0
- sqlspec/observability/_spans.cp314-win_amd64.pyd +0 -0
- sqlspec/observability/_spans.py +161 -0
- sqlspec/protocols.py +955 -0
- sqlspec/py.typed +0 -0
- sqlspec/service.py +433 -0
- sqlspec/storage/__init__.py +48 -0
- sqlspec/storage/_arrow_payload.py +68 -0
- sqlspec/storage/_paths.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/_paths.py +58 -0
- sqlspec/storage/_utils.py +46 -0
- sqlspec/storage/backends/__init__.py +1 -0
- sqlspec/storage/backends/base.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/backends/base.py +374 -0
- sqlspec/storage/backends/fsspec.py +574 -0
- sqlspec/storage/backends/local.py +468 -0
- sqlspec/storage/backends/obstore.py +956 -0
- sqlspec/storage/errors.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/errors.py +102 -0
- sqlspec/storage/pipeline.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/pipeline.py +628 -0
- sqlspec/storage/registry.cp314-win_amd64.pyd +0 -0
- sqlspec/storage/registry.py +329 -0
- sqlspec/typing.py +405 -0
- sqlspec/utils/__init__.py +7 -0
- sqlspec/utils/arrow_helpers.py +384 -0
- sqlspec/utils/config_tools.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/config_tools.py +314 -0
- sqlspec/utils/correlation.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/correlation.py +134 -0
- sqlspec/utils/deprecation.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/deprecation.py +157 -0
- sqlspec/utils/dispatch.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/dispatch.py +101 -0
- sqlspec/utils/fixtures.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/fixtures.py +260 -0
- sqlspec/utils/logging.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/logging.py +251 -0
- sqlspec/utils/module_loader.py +306 -0
- sqlspec/utils/portal.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/portal.py +377 -0
- sqlspec/utils/schema.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/schema.py +1040 -0
- sqlspec/utils/serializers/__init__.py +30 -0
- sqlspec/utils/serializers/_json.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/serializers/_json.py +415 -0
- sqlspec/utils/serializers/_numpy.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/serializers/_numpy.py +65 -0
- sqlspec/utils/serializers/_schema.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/serializers/_schema.py +285 -0
- sqlspec/utils/singleton.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/singleton.py +41 -0
- sqlspec/utils/sync_tools.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/sync_tools.py +316 -0
- sqlspec/utils/text.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/text.py +109 -0
- sqlspec/utils/type_converters.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/type_converters.py +216 -0
- sqlspec/utils/type_guards.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/type_guards.py +1508 -0
- sqlspec/utils/uuids.cp314-win_amd64.pyd +0 -0
- sqlspec/utils/uuids.py +241 -0
- sqlspec-0.47.0.dist-info/METADATA +202 -0
- sqlspec-0.47.0.dist-info/RECORD +621 -0
- sqlspec-0.47.0.dist-info/WHEEL +4 -0
- sqlspec-0.47.0.dist-info/entry_points.txt +6 -0
- sqlspec-0.47.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
# pyright: reportPrivateUsage=false
|
|
2
|
+
import asyncio
|
|
3
|
+
import logging
|
|
4
|
+
from collections.abc import AsyncIterator, Iterator
|
|
5
|
+
from functools import partial
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import TYPE_CHECKING, Any, ClassVar, cast, overload
|
|
8
|
+
from urllib.parse import urlparse
|
|
9
|
+
|
|
10
|
+
from mypy_extensions import mypyc_attr
|
|
11
|
+
|
|
12
|
+
from sqlspec.storage._paths import resolve_storage_path
|
|
13
|
+
from sqlspec.storage._utils import import_pyarrow_parquet
|
|
14
|
+
from sqlspec.storage.backends.base import AsyncArrowBatchIterator, AsyncThreadedBytesIterator
|
|
15
|
+
from sqlspec.storage.errors import execute_sync_storage_operation
|
|
16
|
+
from sqlspec.utils.logging import get_logger, log_with_context
|
|
17
|
+
from sqlspec.utils.module_loader import ensure_fsspec
|
|
18
|
+
from sqlspec.utils.sync_tools import async_
|
|
19
|
+
|
|
20
|
+
if TYPE_CHECKING:
|
|
21
|
+
from sqlspec.typing import ArrowRecordBatch, ArrowTable
|
|
22
|
+
|
|
23
|
+
__all__ = ("FSSpecBackend",)
|
|
24
|
+
|
|
25
|
+
logger = get_logger(__name__)
|
|
26
|
+
|
|
27
|
+
_OBJECT_STORE_PROTOCOLS = {"s3", "gs", "az", "gcs"}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _log_storage_event(
|
|
31
|
+
event: str,
|
|
32
|
+
*,
|
|
33
|
+
backend_type: str,
|
|
34
|
+
protocol: str,
|
|
35
|
+
operation: str | None = None,
|
|
36
|
+
path: str | None = None,
|
|
37
|
+
source_path: str | None = None,
|
|
38
|
+
destination_path: str | None = None,
|
|
39
|
+
count: int | None = None,
|
|
40
|
+
exists: bool | None = None,
|
|
41
|
+
) -> None:
|
|
42
|
+
fields: dict[str, Any] = {
|
|
43
|
+
"backend_type": backend_type,
|
|
44
|
+
"protocol": protocol,
|
|
45
|
+
"path": path,
|
|
46
|
+
"source_path": source_path,
|
|
47
|
+
"destination_path": destination_path,
|
|
48
|
+
"count": count,
|
|
49
|
+
"exists": exists,
|
|
50
|
+
}
|
|
51
|
+
if operation is not None:
|
|
52
|
+
fields["operation"] = operation
|
|
53
|
+
log_with_context(logger, logging.DEBUG, event, **fields)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _write_fsspec_bytes(fs: Any, resolved_path: str, data: bytes, options: "dict[str, Any]") -> None:
|
|
57
|
+
"""Write raw bytes via an fsspec filesystem handle."""
|
|
58
|
+
with fs.open(resolved_path, mode="wb", **options) as file_obj:
|
|
59
|
+
file_obj.write(data) # pyright: ignore
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def _write_fsspec_arrow(fs: Any, resolved_path: str, table: "ArrowTable", pq: Any, options: "dict[str, Any]") -> None:
|
|
63
|
+
"""Write an Arrow table via an fsspec filesystem handle."""
|
|
64
|
+
with fs.open(resolved_path, mode="wb") as file_obj:
|
|
65
|
+
pq.write_table(table, file_obj, **options) # pyright: ignore
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
@mypyc_attr(allow_interpreted_subclasses=True)
|
|
69
|
+
class FSSpecBackend:
|
|
70
|
+
"""Storage backend using fsspec.
|
|
71
|
+
|
|
72
|
+
Implements ObjectStoreProtocol using fsspec for various protocols
|
|
73
|
+
including HTTP, HTTPS, FTP, and cloud storage services.
|
|
74
|
+
|
|
75
|
+
All synchronous methods use the *_sync suffix for consistency with async methods.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
__slots__ = ("_fs_uri", "base_path", "fs", "protocol")
|
|
79
|
+
|
|
80
|
+
backend_type: ClassVar[str] = "fsspec"
|
|
81
|
+
|
|
82
|
+
def __init__(self, uri: str, **kwargs: Any) -> None:
|
|
83
|
+
"""Initialize the fsspec-backed storage backend.
|
|
84
|
+
|
|
85
|
+
Args:
|
|
86
|
+
uri: Filesystem URI (protocol://path).
|
|
87
|
+
**kwargs: Additional fsspec configuration options, including an optional base_path.
|
|
88
|
+
|
|
89
|
+
For cloud URIs (S3/GS/Azure) and file:// URIs, we derive a default base_path from the
|
|
90
|
+
URI path when no explicit base_path is provided. When both URI and base_path are provided,
|
|
91
|
+
they are combined (base_path is appended to URI-derived path).
|
|
92
|
+
|
|
93
|
+
Examples:
|
|
94
|
+
- FSSpecBackend("s3://bucket/prefix") -> base_path = "bucket/prefix"
|
|
95
|
+
- FSSpecBackend("file:///home/user/storage") -> base_path = "/home/user/storage"
|
|
96
|
+
- FSSpecBackend("file:///home/user", base_path="subdir") -> base_path = "/home/user/subdir"
|
|
97
|
+
"""
|
|
98
|
+
ensure_fsspec()
|
|
99
|
+
import fsspec
|
|
100
|
+
|
|
101
|
+
explicit_base_path = kwargs.pop("base_path", "")
|
|
102
|
+
|
|
103
|
+
if "://" in uri:
|
|
104
|
+
self.protocol = uri.split("://", maxsplit=1)[0]
|
|
105
|
+
self._fs_uri = uri
|
|
106
|
+
|
|
107
|
+
if self.protocol in _OBJECT_STORE_PROTOCOLS:
|
|
108
|
+
parsed = urlparse(uri)
|
|
109
|
+
if parsed.netloc:
|
|
110
|
+
uri_base_path = parsed.netloc
|
|
111
|
+
if parsed.path and parsed.path != "/":
|
|
112
|
+
uri_base_path = f"{uri_base_path}{parsed.path}"
|
|
113
|
+
# Combine URI path with explicit base_path if both provided
|
|
114
|
+
if explicit_base_path:
|
|
115
|
+
uri_base_path = f"{uri_base_path.rstrip('/')}/{explicit_base_path.lstrip('/')}"
|
|
116
|
+
explicit_base_path = uri_base_path
|
|
117
|
+
elif self.protocol == "file":
|
|
118
|
+
parsed = urlparse(uri)
|
|
119
|
+
if parsed.path and parsed.path != "/":
|
|
120
|
+
# For file protocol, keep the path as-is (preserve leading slash for absolute paths)
|
|
121
|
+
uri_base_path = parsed.path
|
|
122
|
+
# Combine URI path with explicit base_path if both provided
|
|
123
|
+
if explicit_base_path:
|
|
124
|
+
uri_base_path = f"{uri_base_path.rstrip('/')}/{explicit_base_path.lstrip('/')}"
|
|
125
|
+
explicit_base_path = uri_base_path
|
|
126
|
+
else:
|
|
127
|
+
self.protocol = uri
|
|
128
|
+
self._fs_uri = f"{uri}://"
|
|
129
|
+
|
|
130
|
+
self.base_path = explicit_base_path.rstrip("/") if explicit_base_path else ""
|
|
131
|
+
|
|
132
|
+
self.fs = fsspec.filesystem(self.protocol, **kwargs)
|
|
133
|
+
_log_storage_event(
|
|
134
|
+
"storage.backend.ready",
|
|
135
|
+
backend_type=self.backend_type,
|
|
136
|
+
protocol=self.protocol,
|
|
137
|
+
operation="init",
|
|
138
|
+
path=self._fs_uri,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
super().__init__()
|
|
142
|
+
|
|
143
|
+
@classmethod
|
|
144
|
+
def from_config(cls, config: "dict[str, Any]") -> "FSSpecBackend":
|
|
145
|
+
protocol = config["protocol"]
|
|
146
|
+
fs_config = config.get("fs_config", {})
|
|
147
|
+
base_path = config.get("base_path", "")
|
|
148
|
+
|
|
149
|
+
uri = f"{protocol}://"
|
|
150
|
+
kwargs = dict(fs_config)
|
|
151
|
+
if base_path:
|
|
152
|
+
kwargs["base_path"] = base_path
|
|
153
|
+
|
|
154
|
+
return cls(uri=uri, **kwargs)
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def base_uri(self) -> str:
|
|
158
|
+
return self._fs_uri
|
|
159
|
+
|
|
160
|
+
def _resolve_path(self, path: str | Path) -> str:
|
|
161
|
+
return resolve_storage_path(path, self.base_path, self.protocol, strip_file_scheme=False)
|
|
162
|
+
|
|
163
|
+
def read_bytes_sync(self, path: str | Path, **kwargs: Any) -> bytes:
|
|
164
|
+
"""Read bytes from an object synchronously."""
|
|
165
|
+
resolved_path = self._resolve_path(path)
|
|
166
|
+
result = cast(
|
|
167
|
+
"bytes",
|
|
168
|
+
execute_sync_storage_operation(
|
|
169
|
+
partial(self.fs.cat, resolved_path, **kwargs),
|
|
170
|
+
backend=self.backend_type,
|
|
171
|
+
operation="read_bytes",
|
|
172
|
+
path=resolved_path,
|
|
173
|
+
),
|
|
174
|
+
)
|
|
175
|
+
_log_storage_event(
|
|
176
|
+
"storage.read",
|
|
177
|
+
backend_type=self.backend_type,
|
|
178
|
+
protocol=self.protocol,
|
|
179
|
+
operation="read_bytes",
|
|
180
|
+
path=resolved_path,
|
|
181
|
+
)
|
|
182
|
+
return result
|
|
183
|
+
|
|
184
|
+
def write_bytes_sync(self, path: str | Path, data: bytes, **kwargs: Any) -> None:
|
|
185
|
+
"""Write bytes to an object synchronously."""
|
|
186
|
+
resolved_path = self._resolve_path(path)
|
|
187
|
+
|
|
188
|
+
if self.protocol == "file":
|
|
189
|
+
parent_dir = str(Path(resolved_path).parent)
|
|
190
|
+
if parent_dir and not self.fs.exists(parent_dir):
|
|
191
|
+
self.fs.makedirs(parent_dir, exist_ok=True)
|
|
192
|
+
|
|
193
|
+
execute_sync_storage_operation(
|
|
194
|
+
partial(_write_fsspec_bytes, self.fs, resolved_path, data, kwargs),
|
|
195
|
+
backend=self.backend_type,
|
|
196
|
+
operation="write_bytes",
|
|
197
|
+
path=resolved_path,
|
|
198
|
+
)
|
|
199
|
+
_log_storage_event(
|
|
200
|
+
"storage.write",
|
|
201
|
+
backend_type=self.backend_type,
|
|
202
|
+
protocol=self.protocol,
|
|
203
|
+
operation="write_bytes",
|
|
204
|
+
path=resolved_path,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
def read_text_sync(self, path: str | Path, encoding: str = "utf-8", **kwargs: Any) -> str:
|
|
208
|
+
"""Read text from an object synchronously."""
|
|
209
|
+
data = self.read_bytes_sync(path, **kwargs)
|
|
210
|
+
return data.decode(encoding)
|
|
211
|
+
|
|
212
|
+
def write_text_sync(self, path: str | Path, data: str, encoding: str = "utf-8", **kwargs: Any) -> None:
|
|
213
|
+
"""Write text to an object synchronously."""
|
|
214
|
+
self.write_bytes_sync(path, data.encode(encoding), **kwargs)
|
|
215
|
+
|
|
216
|
+
def exists_sync(self, path: str | Path, **kwargs: Any) -> bool:
|
|
217
|
+
"""Check if an object exists synchronously."""
|
|
218
|
+
resolved_path = self._resolve_path(path)
|
|
219
|
+
exists = bool(self.fs.exists(resolved_path, **kwargs))
|
|
220
|
+
_log_storage_event(
|
|
221
|
+
"storage.read",
|
|
222
|
+
backend_type=self.backend_type,
|
|
223
|
+
protocol=self.protocol,
|
|
224
|
+
operation="exists",
|
|
225
|
+
path=resolved_path,
|
|
226
|
+
exists=bool(exists),
|
|
227
|
+
)
|
|
228
|
+
return exists
|
|
229
|
+
|
|
230
|
+
def delete_sync(self, path: str | Path, **kwargs: Any) -> None:
|
|
231
|
+
"""Delete an object synchronously."""
|
|
232
|
+
resolved_path = self._resolve_path(path)
|
|
233
|
+
execute_sync_storage_operation(
|
|
234
|
+
partial(self.fs.rm, resolved_path, **kwargs),
|
|
235
|
+
backend=self.backend_type,
|
|
236
|
+
operation="delete",
|
|
237
|
+
path=resolved_path,
|
|
238
|
+
)
|
|
239
|
+
_log_storage_event(
|
|
240
|
+
"storage.write",
|
|
241
|
+
backend_type=self.backend_type,
|
|
242
|
+
protocol=self.protocol,
|
|
243
|
+
operation="delete",
|
|
244
|
+
path=resolved_path,
|
|
245
|
+
)
|
|
246
|
+
|
|
247
|
+
def copy_sync(self, source: str | Path, destination: str | Path, **kwargs: Any) -> None:
|
|
248
|
+
"""Copy an object synchronously."""
|
|
249
|
+
source_path = self._resolve_path(source)
|
|
250
|
+
dest_path = self._resolve_path(destination)
|
|
251
|
+
execute_sync_storage_operation(
|
|
252
|
+
partial(self.fs.copy, source_path, dest_path, **kwargs),
|
|
253
|
+
backend=self.backend_type,
|
|
254
|
+
operation="copy",
|
|
255
|
+
path=f"{source_path}->{dest_path}",
|
|
256
|
+
)
|
|
257
|
+
_log_storage_event(
|
|
258
|
+
"storage.write",
|
|
259
|
+
backend_type=self.backend_type,
|
|
260
|
+
protocol=self.protocol,
|
|
261
|
+
operation="copy",
|
|
262
|
+
source_path=source_path,
|
|
263
|
+
destination_path=dest_path,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
def move_sync(self, source: str | Path, destination: str | Path, **kwargs: Any) -> None:
|
|
267
|
+
"""Move an object synchronously."""
|
|
268
|
+
source_path = self._resolve_path(source)
|
|
269
|
+
dest_path = self._resolve_path(destination)
|
|
270
|
+
execute_sync_storage_operation(
|
|
271
|
+
partial(self.fs.mv, source_path, dest_path, **kwargs),
|
|
272
|
+
backend=self.backend_type,
|
|
273
|
+
operation="move",
|
|
274
|
+
path=f"{source_path}->{dest_path}",
|
|
275
|
+
)
|
|
276
|
+
_log_storage_event(
|
|
277
|
+
"storage.write",
|
|
278
|
+
backend_type=self.backend_type,
|
|
279
|
+
protocol=self.protocol,
|
|
280
|
+
operation="move",
|
|
281
|
+
source_path=source_path,
|
|
282
|
+
destination_path=dest_path,
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
def read_arrow_sync(self, path: str | Path, **kwargs: Any) -> "ArrowTable":
|
|
286
|
+
"""Read an Arrow table from storage synchronously."""
|
|
287
|
+
pq = import_pyarrow_parquet()
|
|
288
|
+
|
|
289
|
+
resolved_path = self._resolve_path(path)
|
|
290
|
+
result = cast(
|
|
291
|
+
"ArrowTable",
|
|
292
|
+
execute_sync_storage_operation(
|
|
293
|
+
partial(self._read_parquet_table, resolved_path, pq, kwargs),
|
|
294
|
+
backend=self.backend_type,
|
|
295
|
+
operation="read_arrow",
|
|
296
|
+
path=resolved_path,
|
|
297
|
+
),
|
|
298
|
+
)
|
|
299
|
+
_log_storage_event(
|
|
300
|
+
"storage.read",
|
|
301
|
+
backend_type=self.backend_type,
|
|
302
|
+
protocol=self.protocol,
|
|
303
|
+
operation="read_arrow",
|
|
304
|
+
path=resolved_path,
|
|
305
|
+
)
|
|
306
|
+
return result
|
|
307
|
+
|
|
308
|
+
def write_arrow_sync(self, path: str | Path, table: "ArrowTable", **kwargs: Any) -> None:
|
|
309
|
+
"""Write an Arrow table to storage synchronously."""
|
|
310
|
+
pq = import_pyarrow_parquet()
|
|
311
|
+
|
|
312
|
+
resolved_path = self._resolve_path(path)
|
|
313
|
+
|
|
314
|
+
execute_sync_storage_operation(
|
|
315
|
+
partial(_write_fsspec_arrow, self.fs, resolved_path, table, pq, kwargs),
|
|
316
|
+
backend=self.backend_type,
|
|
317
|
+
operation="write_arrow",
|
|
318
|
+
path=resolved_path,
|
|
319
|
+
)
|
|
320
|
+
_log_storage_event(
|
|
321
|
+
"storage.write",
|
|
322
|
+
backend_type=self.backend_type,
|
|
323
|
+
protocol=self.protocol,
|
|
324
|
+
operation="write_arrow",
|
|
325
|
+
path=resolved_path,
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
def _read_parquet_table(self, resolved_path: str, pq: Any, options: "dict[str, Any]") -> Any:
|
|
329
|
+
with self.fs.open(resolved_path, mode="rb", **options) as file_obj:
|
|
330
|
+
return pq.read_table(file_obj)
|
|
331
|
+
|
|
332
|
+
def list_objects_sync(self, prefix: str = "", recursive: bool = True, **kwargs: Any) -> "list[str]":
|
|
333
|
+
"""List objects with optional prefix synchronously."""
|
|
334
|
+
resolved_prefix = resolve_storage_path(prefix, self.base_path, self.protocol, strip_file_scheme=False)
|
|
335
|
+
if recursive:
|
|
336
|
+
results = sorted(self.fs.find(resolved_prefix, **kwargs))
|
|
337
|
+
else:
|
|
338
|
+
results = sorted(self.fs.ls(resolved_prefix, detail=False, **kwargs))
|
|
339
|
+
_log_storage_event(
|
|
340
|
+
"storage.list",
|
|
341
|
+
backend_type=self.backend_type,
|
|
342
|
+
protocol=self.protocol,
|
|
343
|
+
operation="list_objects",
|
|
344
|
+
path=resolved_prefix,
|
|
345
|
+
count=len(results),
|
|
346
|
+
)
|
|
347
|
+
return results
|
|
348
|
+
|
|
349
|
+
def glob_sync(self, pattern: str, **kwargs: Any) -> "list[str]":
|
|
350
|
+
"""Find objects matching a glob pattern synchronously."""
|
|
351
|
+
resolved_pattern = resolve_storage_path(pattern, self.base_path, self.protocol, strip_file_scheme=False)
|
|
352
|
+
results = sorted(self.fs.glob(resolved_pattern, **kwargs)) # pyright: ignore
|
|
353
|
+
_log_storage_event(
|
|
354
|
+
"storage.list",
|
|
355
|
+
backend_type=self.backend_type,
|
|
356
|
+
protocol=self.protocol,
|
|
357
|
+
operation="glob",
|
|
358
|
+
path=resolved_pattern,
|
|
359
|
+
count=len(results),
|
|
360
|
+
)
|
|
361
|
+
return results
|
|
362
|
+
|
|
363
|
+
def is_object_sync(self, path: str | Path) -> bool:
|
|
364
|
+
"""Check if path points to an object synchronously."""
|
|
365
|
+
resolved_path = resolve_storage_path(path, self.base_path, self.protocol, strip_file_scheme=False)
|
|
366
|
+
return self.fs.exists(resolved_path) and not self.fs.isdir(resolved_path)
|
|
367
|
+
|
|
368
|
+
def is_path_sync(self, path: str | Path) -> bool:
|
|
369
|
+
"""Check if path points to a prefix (directory-like) synchronously."""
|
|
370
|
+
resolved_path = resolve_storage_path(path, self.base_path, self.protocol, strip_file_scheme=False)
|
|
371
|
+
return self.fs.isdir(resolved_path) # type: ignore[no-any-return]
|
|
372
|
+
|
|
373
|
+
def get_metadata_sync(self, path: str | Path, **kwargs: Any) -> "dict[str, object]":
|
|
374
|
+
"""Get object metadata synchronously."""
|
|
375
|
+
resolved_path = resolve_storage_path(path, self.base_path, self.protocol, strip_file_scheme=False)
|
|
376
|
+
try:
|
|
377
|
+
info = self.fs.info(resolved_path, **kwargs)
|
|
378
|
+
except FileNotFoundError:
|
|
379
|
+
return {"path": resolved_path, "exists": False}
|
|
380
|
+
else:
|
|
381
|
+
if isinstance(info, dict):
|
|
382
|
+
return {
|
|
383
|
+
"path": resolved_path,
|
|
384
|
+
"exists": True,
|
|
385
|
+
"size": info.get("size"),
|
|
386
|
+
"last_modified": info.get("mtime"),
|
|
387
|
+
"type": info.get("type", "file"),
|
|
388
|
+
}
|
|
389
|
+
return {
|
|
390
|
+
"path": resolved_path,
|
|
391
|
+
"exists": True,
|
|
392
|
+
"size": info.size,
|
|
393
|
+
"last_modified": info.mtime,
|
|
394
|
+
"type": info.type,
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
@property
|
|
398
|
+
def supports_signing(self) -> bool:
|
|
399
|
+
"""Whether this backend supports URL signing.
|
|
400
|
+
|
|
401
|
+
FSSpec backends do not support URL signing. Use ObStoreBackend
|
|
402
|
+
for S3, GCS, or Azure if you need signed URLs.
|
|
403
|
+
|
|
404
|
+
Returns:
|
|
405
|
+
Always False for fsspec backends.
|
|
406
|
+
"""
|
|
407
|
+
return False
|
|
408
|
+
|
|
409
|
+
@overload
|
|
410
|
+
def sign_sync(self, paths: str, expires_in: int = 3600, for_upload: bool = False) -> str: ...
|
|
411
|
+
|
|
412
|
+
@overload
|
|
413
|
+
def sign_sync(self, paths: "list[str]", expires_in: int = 3600, for_upload: bool = False) -> "list[str]": ...
|
|
414
|
+
|
|
415
|
+
def sign_sync(
|
|
416
|
+
self, paths: "str | list[str]", expires_in: int = 3600, for_upload: bool = False
|
|
417
|
+
) -> "str | list[str]":
|
|
418
|
+
"""Generate signed URL(s).
|
|
419
|
+
|
|
420
|
+
Raises:
|
|
421
|
+
NotImplementedError: fsspec backends do not support URL signing.
|
|
422
|
+
Use obstore backend for S3, GCS, or Azure if you need signed URLs.
|
|
423
|
+
"""
|
|
424
|
+
msg = (
|
|
425
|
+
f"URL signing is not supported for fsspec backend (protocol: {self.protocol}). "
|
|
426
|
+
"For S3, GCS, or Azure signed URLs, use ObStoreBackend instead."
|
|
427
|
+
)
|
|
428
|
+
raise NotImplementedError(msg)
|
|
429
|
+
|
|
430
|
+
def stream_read_sync(self, path: "str | Path", chunk_size: "int | None" = None, **kwargs: Any) -> Iterator[bytes]:
|
|
431
|
+
"""Stream bytes from storage synchronously.
|
|
432
|
+
|
|
433
|
+
Yields:
|
|
434
|
+
Chunks of bytes from the file, with size determined by chunk_size (default: 65536 bytes).
|
|
435
|
+
"""
|
|
436
|
+
resolved_path = self._resolve_path(path)
|
|
437
|
+
chunk_size = chunk_size or 65536
|
|
438
|
+
|
|
439
|
+
with self.fs.open(resolved_path, mode="rb", **kwargs) as f:
|
|
440
|
+
while True:
|
|
441
|
+
chunk = f.read(chunk_size)
|
|
442
|
+
if not chunk:
|
|
443
|
+
break
|
|
444
|
+
yield chunk
|
|
445
|
+
|
|
446
|
+
def stream_arrow_sync(self, pattern: str, **kwargs: Any) -> Iterator["ArrowRecordBatch"]:
|
|
447
|
+
"""Stream Arrow record batches from storage synchronously.
|
|
448
|
+
|
|
449
|
+
Args:
|
|
450
|
+
pattern: The glob pattern to match.
|
|
451
|
+
**kwargs: Additional arguments to pass to the glob method.
|
|
452
|
+
|
|
453
|
+
Yields:
|
|
454
|
+
Arrow record batches from matching files.
|
|
455
|
+
"""
|
|
456
|
+
pq = import_pyarrow_parquet()
|
|
457
|
+
for obj_path in self.glob_sync(pattern, **kwargs):
|
|
458
|
+
file_handle = execute_sync_storage_operation(
|
|
459
|
+
partial(self.fs.open, obj_path, mode="rb"),
|
|
460
|
+
backend=self.backend_type,
|
|
461
|
+
operation="stream_open",
|
|
462
|
+
path=str(obj_path),
|
|
463
|
+
)
|
|
464
|
+
with file_handle as stream:
|
|
465
|
+
parquet_file = execute_sync_storage_operation(
|
|
466
|
+
partial(pq.ParquetFile, stream),
|
|
467
|
+
backend=self.backend_type,
|
|
468
|
+
operation="stream_arrow",
|
|
469
|
+
path=str(obj_path),
|
|
470
|
+
)
|
|
471
|
+
yield from parquet_file.iter_batches() # pyright: ignore[reportUnknownMemberType]
|
|
472
|
+
|
|
473
|
+
async def read_bytes_async(self, path: "str | Path", **kwargs: Any) -> bytes:
|
|
474
|
+
"""Read bytes from storage asynchronously."""
|
|
475
|
+
return await async_(self.read_bytes_sync)(path, **kwargs)
|
|
476
|
+
|
|
477
|
+
async def write_bytes_async(self, path: "str | Path", data: bytes, **kwargs: Any) -> None:
|
|
478
|
+
"""Write bytes to storage asynchronously."""
|
|
479
|
+
return await async_(self.write_bytes_sync)(path, data, **kwargs)
|
|
480
|
+
|
|
481
|
+
async def stream_read_async(
|
|
482
|
+
self, path: "str | Path", chunk_size: "int | None" = None, **kwargs: Any
|
|
483
|
+
) -> AsyncIterator[bytes]:
|
|
484
|
+
"""Stream bytes from storage asynchronously.
|
|
485
|
+
|
|
486
|
+
Uses AsyncThreadedBytesIterator to read chunks of the file in a thread pool,
|
|
487
|
+
ensuring the event loop is not blocked while avoiding buffering the
|
|
488
|
+
entire file into memory.
|
|
489
|
+
|
|
490
|
+
Args:
|
|
491
|
+
path: Path to the file to read.
|
|
492
|
+
chunk_size: Size of chunks to yield (default: 65536 bytes).
|
|
493
|
+
**kwargs: Additional arguments passed to fs.open.
|
|
494
|
+
|
|
495
|
+
Returns:
|
|
496
|
+
AsyncIterator yielding chunks of bytes.
|
|
497
|
+
"""
|
|
498
|
+
resolved_path = self._resolve_path(path)
|
|
499
|
+
chunk_size = chunk_size or 65536
|
|
500
|
+
|
|
501
|
+
# Open the file in a thread pool
|
|
502
|
+
file_obj = await asyncio.to_thread(self.fs.open, resolved_path, mode="rb", **kwargs)
|
|
503
|
+
|
|
504
|
+
return AsyncThreadedBytesIterator(file_obj, chunk_size)
|
|
505
|
+
|
|
506
|
+
def stream_arrow_async(self, pattern: str, **kwargs: Any) -> AsyncIterator["ArrowRecordBatch"]:
|
|
507
|
+
"""Stream Arrow record batches from storage asynchronously.
|
|
508
|
+
|
|
509
|
+
Args:
|
|
510
|
+
pattern: The glob pattern to match.
|
|
511
|
+
**kwargs: Additional arguments to pass to the glob method.
|
|
512
|
+
|
|
513
|
+
Returns:
|
|
514
|
+
AsyncIterator yielding Arrow record batches.
|
|
515
|
+
"""
|
|
516
|
+
return AsyncArrowBatchIterator(self.stream_arrow_sync(pattern, **kwargs))
|
|
517
|
+
|
|
518
|
+
async def read_text_async(self, path: "str | Path", encoding: str = "utf-8", **kwargs: Any) -> str:
|
|
519
|
+
"""Read text from storage asynchronously."""
|
|
520
|
+
return await async_(self.read_text_sync)(path, encoding, **kwargs)
|
|
521
|
+
|
|
522
|
+
async def write_text_async(self, path: str | Path, data: str, encoding: str = "utf-8", **kwargs: Any) -> None:
|
|
523
|
+
"""Write text to storage asynchronously."""
|
|
524
|
+
await async_(self.write_text_sync)(path, data, encoding, **kwargs)
|
|
525
|
+
|
|
526
|
+
async def list_objects_async(self, prefix: str = "", recursive: bool = True, **kwargs: Any) -> "list[str]":
|
|
527
|
+
"""List objects in storage asynchronously."""
|
|
528
|
+
return await async_(self.list_objects_sync)(prefix, recursive, **kwargs)
|
|
529
|
+
|
|
530
|
+
async def exists_async(self, path: str | Path, **kwargs: Any) -> bool:
|
|
531
|
+
"""Check if object exists in storage asynchronously."""
|
|
532
|
+
return await async_(self.exists_sync)(path, **kwargs)
|
|
533
|
+
|
|
534
|
+
async def delete_async(self, path: str | Path, **kwargs: Any) -> None:
|
|
535
|
+
"""Delete object from storage asynchronously."""
|
|
536
|
+
await async_(self.delete_sync)(path, **kwargs)
|
|
537
|
+
|
|
538
|
+
async def copy_async(self, source: str | Path, destination: str | Path, **kwargs: Any) -> None:
|
|
539
|
+
"""Copy object in storage asynchronously."""
|
|
540
|
+
await async_(self.copy_sync)(source, destination, **kwargs)
|
|
541
|
+
|
|
542
|
+
async def move_async(self, source: str | Path, destination: str | Path, **kwargs: Any) -> None:
|
|
543
|
+
"""Move object in storage asynchronously."""
|
|
544
|
+
await async_(self.move_sync)(source, destination, **kwargs)
|
|
545
|
+
|
|
546
|
+
async def get_metadata_async(self, path: str | Path, **kwargs: Any) -> "dict[str, object]":
|
|
547
|
+
"""Get object metadata from storage asynchronously."""
|
|
548
|
+
return await async_(self.get_metadata_sync)(path, **kwargs)
|
|
549
|
+
|
|
550
|
+
@overload
|
|
551
|
+
async def sign_async(self, paths: str, expires_in: int = 3600, for_upload: bool = False) -> str: ...
|
|
552
|
+
|
|
553
|
+
@overload
|
|
554
|
+
async def sign_async(self, paths: "list[str]", expires_in: int = 3600, for_upload: bool = False) -> "list[str]": ...
|
|
555
|
+
|
|
556
|
+
async def sign_async(
|
|
557
|
+
self, paths: "str | list[str]", expires_in: int = 3600, for_upload: bool = False
|
|
558
|
+
) -> "str | list[str]":
|
|
559
|
+
"""Generate signed URL(s) asynchronously."""
|
|
560
|
+
return await async_(self.sign_sync)(paths, expires_in, for_upload) # type: ignore[arg-type]
|
|
561
|
+
|
|
562
|
+
async def read_arrow_async(self, path: str | Path, **kwargs: Any) -> "ArrowTable":
|
|
563
|
+
"""Read Arrow table from storage asynchronously.
|
|
564
|
+
|
|
565
|
+
Uses async_() with storage limiter to offload blocking PyArrow I/O to thread pool.
|
|
566
|
+
"""
|
|
567
|
+
return await async_(self.read_arrow_sync)(path, **kwargs)
|
|
568
|
+
|
|
569
|
+
async def write_arrow_async(self, path: str | Path, table: "ArrowTable", **kwargs: Any) -> None:
|
|
570
|
+
"""Write Arrow table to storage asynchronously.
|
|
571
|
+
|
|
572
|
+
Uses async_() with storage limiter to offload blocking PyArrow I/O to thread pool.
|
|
573
|
+
"""
|
|
574
|
+
await async_(self.write_arrow_sync)(path, table, **kwargs)
|