ducklakepy 0.1.0.dev0__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.
- ducklakepy-0.1.0.dev0/.gitignore +26 -0
- ducklakepy-0.1.0.dev0/LICENSE +202 -0
- ducklakepy-0.1.0.dev0/PKG-INFO +124 -0
- ducklakepy-0.1.0.dev0/README.md +95 -0
- ducklakepy-0.1.0.dev0/pyproject.toml +151 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/__init__.py +21 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_arrow.py +962 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_changes.py +315 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_defaults.py +387 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_encodings.py +69 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_globs.py +131 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_hive.py +235 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_inlined_text.py +470 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_interval.py +63 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_interval_text.py +187 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_json_list.py +206 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_lists.py +60 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_literals.py +135 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_logical_values.py +145 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_names.py +95 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_packing.py +200 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_parallel.py +323 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_parquet_sink.py +135 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_paths.py +259 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_promotions.py +197 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_sources.py +126 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_thrift.py +309 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_time_flags.py +134 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_variant.py +472 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_variant_shredding.py +368 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_version.py +12 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/_wkb.py +80 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/add_files.py +915 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/capabilities.py +429 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/__init__.py +2194 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_dialect.py +730 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_engine.py +60 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_entries.py +163 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_legacy_inlined.py +150 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_migration.py +211 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_namespaces.py +232 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_schema.py +523 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/catalog/_statements.py +175 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/changes.py +965 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/config.py +222 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/constants.py +83 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/encryption.py +474 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/exceptions.py +208 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/expressions.py +1146 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/inlined.py +347 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/io/__init__.py +305 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/io/pyarrow.py +227 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/__init__.py +95 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/_bounds.py +235 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/_common.py +423 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/_versions.py +130 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/checkpoint.py +470 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/cleanup.py +206 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/compaction.py +988 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/expire.py +469 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/maintenance/orphans.py +217 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/options.py +816 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/partitioning/__init__.py +945 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/partitioning/_bounds.py +255 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/partitioning/_value_text.py +130 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/plan.py +1200 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/properties.py +54 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/puffin.py +689 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/py.typed +0 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/rows.py +325 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/scan.py +1156 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/schema.py +455 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/schema_update.py +1143 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/snapshots.py +354 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/sorting.py +436 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/spark/__init__.py +79 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/spark/_feed.py +279 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/spark/_options.py +316 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/spark/_read.py +240 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/spark/_schemas.py +292 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/spark/_source.py +118 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/spark/_write.py +509 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/stats/__init__.py +972 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/stats/_blob_text.py +45 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/stats/_footer.py +280 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/stats/_skipped.py +125 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/stats/_temporal.py +361 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/table.py +555 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/tags.py +116 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/__init__.py +3910 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_commit_sql.py +1293 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_companions.py +156 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_conflicts.py +581 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_delete_files.py +117 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_entries.py +778 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_float_bounds.py +115 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_keys.py +154 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_namespaces.py +115 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_null_bounds.py +176 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_operations.py +146 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_staged.py +585 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/transaction/_table_stats.py +76 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/types.py +423 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/version.py +161 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/views.py +477 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/write_options.py +369 -0
- ducklakepy-0.1.0.dev0/src/ducklakepy/writer.py +944 -0
- ducklakepy-0.1.0.dev0/tests/__init__.py +0 -0
- ducklakepy-0.1.0.dev0/tests/conftest.py +490 -0
- ducklakepy-0.1.0.dev0/tests/fileio.py +283 -0
- ducklakepy-0.1.0.dev0/tests/lake.py +566 -0
- ducklakepy-0.1.0.dev0/tests/test_arrow_mapping.py +673 -0
- ducklakepy-0.1.0.dev0/tests/test_azure_fileio.py +139 -0
- ducklakepy-0.1.0.dev0/tests/test_capabilities.py +605 -0
- ducklakepy-0.1.0.dev0/tests/test_catalog_ddl.py +572 -0
- ducklakepy-0.1.0.dev0/tests/test_catalog_lifecycle.py +165 -0
- ducklakepy-0.1.0.dev0/tests/test_catalog_read.py +347 -0
- ducklakepy-0.1.0.dev0/tests/test_change_feed.py +825 -0
- ducklakepy-0.1.0.dev0/tests/test_changes.py +331 -0
- ducklakepy-0.1.0.dev0/tests/test_ci_shards.py +45 -0
- ducklakepy-0.1.0.dev0/tests/test_cloud_stores.py +215 -0
- ducklakepy-0.1.0.dev0/tests/test_concurrent.py +113 -0
- ducklakepy-0.1.0.dev0/tests/test_concurrent_read.py +833 -0
- ducklakepy-0.1.0.dev0/tests/test_config.py +401 -0
- ducklakepy-0.1.0.dev0/tests/test_conflict_detection.py +510 -0
- ducklakepy-0.1.0.dev0/tests/test_count.py +434 -0
- ducklakepy-0.1.0.dev0/tests/test_cross_impl.py +1017 -0
- ducklakepy-0.1.0.dev0/tests/test_database_pool.py +69 -0
- ducklakepy-0.1.0.dev0/tests/test_delete.py +946 -0
- ducklakepy-0.1.0.dev0/tests/test_dialect.py +640 -0
- ducklakepy-0.1.0.dev0/tests/test_dictionary_encoding.py +153 -0
- ducklakepy-0.1.0.dev0/tests/test_drop.py +171 -0
- ducklakepy-0.1.0.dev0/tests/test_encryption.py +746 -0
- ducklakepy-0.1.0.dev0/tests/test_expressions.py +1245 -0
- ducklakepy-0.1.0.dev0/tests/test_footer_stats.py +640 -0
- ducklakepy-0.1.0.dev0/tests/test_gcs_fileio.py +147 -0
- ducklakepy-0.1.0.dev0/tests/test_infinite_temporals.py +1303 -0
- ducklakepy-0.1.0.dev0/tests/test_inlined_nested.py +301 -0
- ducklakepy-0.1.0.dev0/tests/test_inlined_text.py +352 -0
- ducklakepy-0.1.0.dev0/tests/test_inlined_variants.py +464 -0
- ducklakepy-0.1.0.dev0/tests/test_inlined_writes.py +1097 -0
- ducklakepy-0.1.0.dev0/tests/test_io.py +291 -0
- ducklakepy-0.1.0.dev0/tests/test_maintenance_checkpoint.py +750 -0
- ducklakepy-0.1.0.dev0/tests/test_maintenance_cleanup.py +619 -0
- ducklakepy-0.1.0.dev0/tests/test_maintenance_compaction.py +1679 -0
- ducklakepy-0.1.0.dev0/tests/test_maintenance_expire.py +655 -0
- ducklakepy-0.1.0.dev0/tests/test_maintenance_orphans.py +346 -0
- ducklakepy-0.1.0.dev0/tests/test_module_size.py +66 -0
- ducklakepy-0.1.0.dev0/tests/test_multi_file_writes.py +1036 -0
- ducklakepy-0.1.0.dev0/tests/test_nested_predicates.py +514 -0
- ducklakepy-0.1.0.dev0/tests/test_nested_schemas.py +623 -0
- ducklakepy-0.1.0.dev0/tests/test_nested_writes.py +1794 -0
- ducklakepy-0.1.0.dev0/tests/test_options.py +1215 -0
- ducklakepy-0.1.0.dev0/tests/test_partial_files.py +169 -0
- ducklakepy-0.1.0.dev0/tests/test_partition_bounds.py +679 -0
- ducklakepy-0.1.0.dev0/tests/test_partitioning.py +1325 -0
- ducklakepy-0.1.0.dev0/tests/test_paths.py +183 -0
- ducklakepy-0.1.0.dev0/tests/test_puffin.py +1440 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_add_files.py +3397 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_alter.py +1676 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_deletes.py +319 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_inlining.py +224 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_migration.py +561 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_partitioning.py +1184 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_paths.py +125 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_rowid.py +107 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_snapshot_info.py +169 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_sorting.py +689 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_stats.py +485 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_table_changes.py +382 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_time_travel.py +140 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_transactions.py +253 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_update.py +373 -0
- ducklakepy-0.1.0.dev0/tests/test_reference_views.py +315 -0
- ducklakepy-0.1.0.dev0/tests/test_row_group_pruning.py +328 -0
- ducklakepy-0.1.0.dev0/tests/test_rows.py +31 -0
- ducklakepy-0.1.0.dev0/tests/test_scan.py +643 -0
- ducklakepy-0.1.0.dev0/tests/test_scan_batches.py +276 -0
- ducklakepy-0.1.0.dev0/tests/test_schema.py +319 -0
- ducklakepy-0.1.0.dev0/tests/test_schema_evolution.py +2378 -0
- ducklakepy-0.1.0.dev0/tests/test_sequences.py +221 -0
- ducklakepy-0.1.0.dev0/tests/test_shredded_variants.py +244 -0
- ducklakepy-0.1.0.dev0/tests/test_skip_stats.py +452 -0
- ducklakepy-0.1.0.dev0/tests/test_sorting.py +927 -0
- ducklakepy-0.1.0.dev0/tests/test_spark.py +1950 -0
- ducklakepy-0.1.0.dev0/tests/test_spark_packing.py +252 -0
- ducklakepy-0.1.0.dev0/tests/test_spec_version.py +445 -0
- ducklakepy-0.1.0.dev0/tests/test_stats.py +844 -0
- ducklakepy-0.1.0.dev0/tests/test_table_append.py +430 -0
- ducklakepy-0.1.0.dev0/tests/test_transaction_ops.py +1309 -0
- ducklakepy-0.1.0.dev0/tests/test_type_writes.py +1079 -0
- ducklakepy-0.1.0.dev0/tests/test_update.py +590 -0
- ducklakepy-0.1.0.dev0/tests/test_upsert.py +422 -0
- ducklakepy-0.1.0.dev0/tests/test_variant_bytes.py +377 -0
- ducklakepy-0.1.0.dev0/tests/test_variant_shredding.py +311 -0
- ducklakepy-0.1.0.dev0/tests/test_views.py +652 -0
- ducklakepy-0.1.0.dev0/tests/test_write_measurement.py +171 -0
- ducklakepy-0.1.0.dev0/tests/test_write_validation.py +117 -0
- ducklakepy-0.1.0.dev0/tests/writing.py +91 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.claude/*
|
|
2
|
+
!.claude/skills/
|
|
3
|
+
.venv/
|
|
4
|
+
venv/
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
*.egg-info/
|
|
8
|
+
build/
|
|
9
|
+
dist/
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.ruff_cache/
|
|
12
|
+
.mypy_cache/
|
|
13
|
+
.coverage
|
|
14
|
+
htmlcov/
|
|
15
|
+
.DS_Store
|
|
16
|
+
|
|
17
|
+
# Documentation site
|
|
18
|
+
docs/node_modules/
|
|
19
|
+
docs/.next/
|
|
20
|
+
docs/.next-node-stamp
|
|
21
|
+
docs/out/
|
|
22
|
+
docs/.source/
|
|
23
|
+
# Generated from docstrings by docs/tools/gen_api.py; never committed.
|
|
24
|
+
docs/content/docs/api/
|
|
25
|
+
next-env.d.ts
|
|
26
|
+
docs/.next-env.d.ts
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: ducklakepy
|
|
3
|
+
Version: 0.1.0.dev0
|
|
4
|
+
Summary: A Python implementation of the DuckLake specification
|
|
5
|
+
Project-URL: Homepage, https://dejii.github.io/ducklake-python/
|
|
6
|
+
Project-URL: Documentation, https://dejii.github.io/ducklake-python/
|
|
7
|
+
Project-URL: Source, https://github.com/dejii/ducklake-python
|
|
8
|
+
Project-URL: Issues, https://github.com/dejii/ducklake-python/issues
|
|
9
|
+
Author: ducklakepy contributors
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Requires-Dist: numpy>=1.26
|
|
19
|
+
Requires-Dist: pyarrow>=18.0
|
|
20
|
+
Requires-Dist: pydantic>=2.5
|
|
21
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
22
|
+
Provides-Extra: encryption
|
|
23
|
+
Requires-Dist: cryptography>=42; extra == 'encryption'
|
|
24
|
+
Provides-Extra: postgres
|
|
25
|
+
Requires-Dist: psycopg[binary]>=3.1; extra == 'postgres'
|
|
26
|
+
Provides-Extra: spark
|
|
27
|
+
Requires-Dist: pyspark>=4.1; extra == 'spark'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# ducklakepy
|
|
31
|
+
|
|
32
|
+
A Python implementation of the [DuckLake specification](https://ducklake.select/docs/stable/specification/introduction), the open
|
|
33
|
+
lakehouse format published at [ducklake.select](https://ducklake.select).
|
|
34
|
+
|
|
35
|
+
DuckLake keeps a table's metadata in a SQL database and its rows in Parquet files.
|
|
36
|
+
ducklakepy speaks to both directly, so a Python program can create tables, append Arrow
|
|
37
|
+
data, read at any snapshot, update and delete rows and evolve schemas without a DuckDB
|
|
38
|
+
process. A
|
|
39
|
+
lake written by ducklakepy is readable by DuckDB's `ducklake` extension, and the other way
|
|
40
|
+
round, so the two can share one lake. If you know PyIceberg, ducklakepy plays the same
|
|
41
|
+
role for DuckLake.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install ducklakepy[postgres] # with the Postgres catalog driver
|
|
45
|
+
pip install ducklakepy # SQLite only
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Python 3.11 or newer.
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
import pyarrow as pa
|
|
52
|
+
|
|
53
|
+
from ducklakepy import DuckLakeCatalog
|
|
54
|
+
from ducklakepy.schema import Column, Schema
|
|
55
|
+
from ducklakepy.types import Int64Type, VarcharType
|
|
56
|
+
|
|
57
|
+
with DuckLakeCatalog("demo", url="sqlite:///lake.sqlite", data_path="lake_data/") as catalog:
|
|
58
|
+
catalog.initialize()
|
|
59
|
+
|
|
60
|
+
events = catalog.create_table(
|
|
61
|
+
"main.events",
|
|
62
|
+
schema=Schema(
|
|
63
|
+
Column("id", Int64Type(), required=True),
|
|
64
|
+
Column("name", VarcharType()),
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
events.append(pa.table({"id": [1, 2, 3], "name": ["signup", "login", "purchase"]}))
|
|
68
|
+
|
|
69
|
+
print(catalog.load_table("main.events").to_arrow())
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The same lake, from DuckDB:
|
|
73
|
+
|
|
74
|
+
```sql
|
|
75
|
+
ATTACH 'ducklake:sqlite:lake.sqlite' AS lake (DATA_PATH 'lake_data/');
|
|
76
|
+
SELECT rowid, id, name FROM lake.main.events ORDER BY id;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Status: pre-alpha.** Reads, writes, updates and upserts, deletes, change feeds, schema
|
|
80
|
+
evolution, transactions, partitioned and sorted writes, registering existing Parquet files,
|
|
81
|
+
encrypted catalogs, maintenance (expiring snapshots, compaction, cleanup) and a Spark data
|
|
82
|
+
source all work today, against SQLite and Postgres catalogs and over local files, S3, GCS
|
|
83
|
+
and Azure Blob Storage, nested columns included. Every test run cross-checks the lake
|
|
84
|
+
against DuckDB on both catalog backends. The
|
|
85
|
+
[feature support](https://dejii.github.io/ducklake-python/docs/reference/support/) table says
|
|
86
|
+
what each table layout allows.
|
|
87
|
+
|
|
88
|
+
## Documentation
|
|
89
|
+
|
|
90
|
+
The documentation lives at **<https://dejii.github.io/ducklake-python/>**. Every page is
|
|
91
|
+
also readable as plain Markdown (append `/llms.mdx` in front of a page's path, or take
|
|
92
|
+
all of it from [`llms-full.txt`](https://dejii.github.io/ducklake-python/llms-full.txt)),
|
|
93
|
+
and every code example on a page is a region of a runnable file under
|
|
94
|
+
[`docs/examples/`](docs/examples/) that the test suite executes and checks the page against.
|
|
95
|
+
To run the site locally, `make docs` (Node 22.12 or newer; there is a `.nvmrc`) and open
|
|
96
|
+
<http://localhost:3000/docs>.
|
|
97
|
+
|
|
98
|
+
| | |
|
|
99
|
+
|---|---|
|
|
100
|
+
| [Getting started](https://dejii.github.io/ducklake-python/docs/getting-started/) | Install, then a quickstart: a lake on SQLite, written and read back from Python and from DuckDB |
|
|
101
|
+
| [Concepts](https://dejii.github.io/ducklake-python/docs/concepts/) | How DuckLake works: snapshots, tables and schemas, where rows live, the ducklakepy object model, a glossary |
|
|
102
|
+
| [Guides](https://dejii.github.io/ducklake-python/docs/guides/catalogs/) | One task per page: connect to a catalog, create tables, write, read, time travel, change feeds, update, delete, evolve a schema, transactions, partition, sort, flush, maintain, register existing files, object storage, encryption, distributed reads, Spark, use with DuckDB |
|
|
103
|
+
| [Reference](https://dejii.github.io/ducklake-python/docs/reference/support/) | Feature support by table layout, types, the expression DSL, configuration, write options, errors, catalog backends |
|
|
104
|
+
| [API reference](https://dejii.github.io/ducklake-python/docs/api/) | Every public module, generated from the docstrings |
|
|
105
|
+
| [Internals](https://dejii.github.io/ducklake-python/docs/internals/) | How it works underneath the API, and why |
|
|
106
|
+
|
|
107
|
+
## Contributing
|
|
108
|
+
|
|
109
|
+
[`CONTRIBUTING.md`](CONTRIBUTING.md) has the setup, the checks CI runs and the test
|
|
110
|
+
lanes. In short:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
uv venv .venv && uv sync --extra postgres
|
|
114
|
+
.venv/bin/ruff format src tests && .venv/bin/ruff check src tests && .venv/bin/mypy
|
|
115
|
+
.venv/bin/pytest -m "not integration" # fast lane, no Docker
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## License
|
|
119
|
+
|
|
120
|
+
Apache License 2.0. See [`LICENSE`](LICENSE).
|
|
121
|
+
|
|
122
|
+
ducklakepy is an independent project. It is not affiliated with, sponsored by or endorsed
|
|
123
|
+
by DuckDB Labs or the DuckDB Foundation. DuckDB and DuckLake are their trademarks, used
|
|
124
|
+
here to describe what this library implements.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# ducklakepy
|
|
2
|
+
|
|
3
|
+
A Python implementation of the [DuckLake specification](https://ducklake.select/docs/stable/specification/introduction), the open
|
|
4
|
+
lakehouse format published at [ducklake.select](https://ducklake.select).
|
|
5
|
+
|
|
6
|
+
DuckLake keeps a table's metadata in a SQL database and its rows in Parquet files.
|
|
7
|
+
ducklakepy speaks to both directly, so a Python program can create tables, append Arrow
|
|
8
|
+
data, read at any snapshot, update and delete rows and evolve schemas without a DuckDB
|
|
9
|
+
process. A
|
|
10
|
+
lake written by ducklakepy is readable by DuckDB's `ducklake` extension, and the other way
|
|
11
|
+
round, so the two can share one lake. If you know PyIceberg, ducklakepy plays the same
|
|
12
|
+
role for DuckLake.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install ducklakepy[postgres] # with the Postgres catalog driver
|
|
16
|
+
pip install ducklakepy # SQLite only
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Python 3.11 or newer.
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
import pyarrow as pa
|
|
23
|
+
|
|
24
|
+
from ducklakepy import DuckLakeCatalog
|
|
25
|
+
from ducklakepy.schema import Column, Schema
|
|
26
|
+
from ducklakepy.types import Int64Type, VarcharType
|
|
27
|
+
|
|
28
|
+
with DuckLakeCatalog("demo", url="sqlite:///lake.sqlite", data_path="lake_data/") as catalog:
|
|
29
|
+
catalog.initialize()
|
|
30
|
+
|
|
31
|
+
events = catalog.create_table(
|
|
32
|
+
"main.events",
|
|
33
|
+
schema=Schema(
|
|
34
|
+
Column("id", Int64Type(), required=True),
|
|
35
|
+
Column("name", VarcharType()),
|
|
36
|
+
),
|
|
37
|
+
)
|
|
38
|
+
events.append(pa.table({"id": [1, 2, 3], "name": ["signup", "login", "purchase"]}))
|
|
39
|
+
|
|
40
|
+
print(catalog.load_table("main.events").to_arrow())
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The same lake, from DuckDB:
|
|
44
|
+
|
|
45
|
+
```sql
|
|
46
|
+
ATTACH 'ducklake:sqlite:lake.sqlite' AS lake (DATA_PATH 'lake_data/');
|
|
47
|
+
SELECT rowid, id, name FROM lake.main.events ORDER BY id;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Status: pre-alpha.** Reads, writes, updates and upserts, deletes, change feeds, schema
|
|
51
|
+
evolution, transactions, partitioned and sorted writes, registering existing Parquet files,
|
|
52
|
+
encrypted catalogs, maintenance (expiring snapshots, compaction, cleanup) and a Spark data
|
|
53
|
+
source all work today, against SQLite and Postgres catalogs and over local files, S3, GCS
|
|
54
|
+
and Azure Blob Storage, nested columns included. Every test run cross-checks the lake
|
|
55
|
+
against DuckDB on both catalog backends. The
|
|
56
|
+
[feature support](https://dejii.github.io/ducklake-python/docs/reference/support/) table says
|
|
57
|
+
what each table layout allows.
|
|
58
|
+
|
|
59
|
+
## Documentation
|
|
60
|
+
|
|
61
|
+
The documentation lives at **<https://dejii.github.io/ducklake-python/>**. Every page is
|
|
62
|
+
also readable as plain Markdown (append `/llms.mdx` in front of a page's path, or take
|
|
63
|
+
all of it from [`llms-full.txt`](https://dejii.github.io/ducklake-python/llms-full.txt)),
|
|
64
|
+
and every code example on a page is a region of a runnable file under
|
|
65
|
+
[`docs/examples/`](docs/examples/) that the test suite executes and checks the page against.
|
|
66
|
+
To run the site locally, `make docs` (Node 22.12 or newer; there is a `.nvmrc`) and open
|
|
67
|
+
<http://localhost:3000/docs>.
|
|
68
|
+
|
|
69
|
+
| | |
|
|
70
|
+
|---|---|
|
|
71
|
+
| [Getting started](https://dejii.github.io/ducklake-python/docs/getting-started/) | Install, then a quickstart: a lake on SQLite, written and read back from Python and from DuckDB |
|
|
72
|
+
| [Concepts](https://dejii.github.io/ducklake-python/docs/concepts/) | How DuckLake works: snapshots, tables and schemas, where rows live, the ducklakepy object model, a glossary |
|
|
73
|
+
| [Guides](https://dejii.github.io/ducklake-python/docs/guides/catalogs/) | One task per page: connect to a catalog, create tables, write, read, time travel, change feeds, update, delete, evolve a schema, transactions, partition, sort, flush, maintain, register existing files, object storage, encryption, distributed reads, Spark, use with DuckDB |
|
|
74
|
+
| [Reference](https://dejii.github.io/ducklake-python/docs/reference/support/) | Feature support by table layout, types, the expression DSL, configuration, write options, errors, catalog backends |
|
|
75
|
+
| [API reference](https://dejii.github.io/ducklake-python/docs/api/) | Every public module, generated from the docstrings |
|
|
76
|
+
| [Internals](https://dejii.github.io/ducklake-python/docs/internals/) | How it works underneath the API, and why |
|
|
77
|
+
|
|
78
|
+
## Contributing
|
|
79
|
+
|
|
80
|
+
[`CONTRIBUTING.md`](CONTRIBUTING.md) has the setup, the checks CI runs and the test
|
|
81
|
+
lanes. In short:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
uv venv .venv && uv sync --extra postgres
|
|
85
|
+
.venv/bin/ruff format src tests && .venv/bin/ruff check src tests && .venv/bin/mypy
|
|
86
|
+
.venv/bin/pytest -m "not integration" # fast lane, no Docker
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## License
|
|
90
|
+
|
|
91
|
+
Apache License 2.0. See [`LICENSE`](LICENSE).
|
|
92
|
+
|
|
93
|
+
ducklakepy is an independent project. It is not affiliated with, sponsored by or endorsed
|
|
94
|
+
by DuckDB Labs or the DuckDB Foundation. DuckDB and DuckLake are their trademarks, used
|
|
95
|
+
here to describe what this library implements.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ducklakepy"
|
|
7
|
+
version = "0.1.0.dev0"
|
|
8
|
+
description = "A Python implementation of the DuckLake specification"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "ducklakepy contributors" }]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"sqlalchemy>=2.0",
|
|
23
|
+
"pyarrow>=18.0",
|
|
24
|
+
"numpy>=1.26",
|
|
25
|
+
"pydantic>=2.5",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
postgres = ["psycopg[binary]>=3.1"]
|
|
30
|
+
encryption = ["cryptography>=42"]
|
|
31
|
+
# The PySpark data source (ducklakepy.spark); Spark 4.1 is where filter pushdown arrived.
|
|
32
|
+
spark = ["pyspark>=4.1"]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://dejii.github.io/ducklake-python/"
|
|
36
|
+
Documentation = "https://dejii.github.io/ducklake-python/"
|
|
37
|
+
Source = "https://github.com/dejii/ducklake-python"
|
|
38
|
+
Issues = "https://github.com/dejii/ducklake-python/issues"
|
|
39
|
+
|
|
40
|
+
[dependency-groups]
|
|
41
|
+
# Not installed by default: `uv sync --group docs` for the documentation site's
|
|
42
|
+
# Python tooling (docs/tools/gen_api.py). Contributors who only run the test
|
|
43
|
+
# suite never see it.
|
|
44
|
+
docs = ["griffe>=2.3"]
|
|
45
|
+
dev = [
|
|
46
|
+
"pytest>=8.0",
|
|
47
|
+
"pytest-xdist>=3.5",
|
|
48
|
+
"pytest-timeout>=2.3",
|
|
49
|
+
"ruff>=0.5",
|
|
50
|
+
"mypy>=1.10",
|
|
51
|
+
"pre-commit>=3.5",
|
|
52
|
+
"testcontainers[postgres]>=4.0",
|
|
53
|
+
"psycopg[binary]>=3.1",
|
|
54
|
+
"cryptography>=42",
|
|
55
|
+
"duckdb>=2.0",
|
|
56
|
+
"pyyaml>=6.0",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.wheel]
|
|
60
|
+
packages = ["src/ducklakepy"]
|
|
61
|
+
|
|
62
|
+
[tool.hatch.build.targets.sdist]
|
|
63
|
+
include = ["src/ducklakepy", "tests", "/README.md", "/LICENSE"]
|
|
64
|
+
|
|
65
|
+
[tool.ruff]
|
|
66
|
+
line-length = 120
|
|
67
|
+
target-version = "py311"
|
|
68
|
+
src = ["src", "tests"]
|
|
69
|
+
|
|
70
|
+
[tool.ruff.format]
|
|
71
|
+
docstring-code-format = true
|
|
72
|
+
|
|
73
|
+
[tool.ruff.lint]
|
|
74
|
+
select = [
|
|
75
|
+
"E", "W", "F", "I", "B", "UP", "SIM", "TID",
|
|
76
|
+
"C4", "PIE", "RET", "ISC", "RUF", "FURB", "PERF", "PL",
|
|
77
|
+
"PT", # pytest idioms
|
|
78
|
+
"TC", # imports needed only for annotations live under TYPE_CHECKING
|
|
79
|
+
"T20", "ERA", # no print, no commented-out code
|
|
80
|
+
"N", "PTH", "ARG", "S",
|
|
81
|
+
]
|
|
82
|
+
ignore = [
|
|
83
|
+
"PLR2004", "PLR0911", "PLR0912", "PLR0913", "PLR0915", # magic numbers and size limits are judgement calls
|
|
84
|
+
"S101", # assert states an invariant of ducklakepy's own values or narrows a type it produced; bytes read from a file are checked with a raise, so nothing relies on -O
|
|
85
|
+
"S608", # SQL text is assembled from catalog identifiers the dialects quote, never from user input
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[tool.ruff.lint.per-file-ignores]
|
|
89
|
+
"tests/*" = [
|
|
90
|
+
"S105", "S108", # test credentials and temp paths
|
|
91
|
+
"B011",
|
|
92
|
+
# A test imports inside the test body to patch a module attribute, to
|
|
93
|
+
# reach a private name, or to prove an import fails; the convention
|
|
94
|
+
# PLC0415 enforces is about the package's own acyclicity.
|
|
95
|
+
"PLC0415",
|
|
96
|
+
]
|
|
97
|
+
# The docs tooling is command-line scripts and runnable examples: printing is
|
|
98
|
+
# their interface, and an example is written the way a reader would write it.
|
|
99
|
+
"docs/tools/*" = ["T201"]
|
|
100
|
+
# An example is written the way a reader would write it, which includes
|
|
101
|
+
# importing inside a function to show what that function needs.
|
|
102
|
+
"docs/examples/*" = ["T201", "PT018", "PLC0415"]
|
|
103
|
+
# The benchmark harness is a command-line script: printing the results as it
|
|
104
|
+
# goes is its interface.
|
|
105
|
+
"docs/benchmarks/*" = ["T201"]
|
|
106
|
+
|
|
107
|
+
[tool.ruff.lint.flake8-type-checking]
|
|
108
|
+
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
|
|
109
|
+
|
|
110
|
+
[tool.ruff.lint.pylint]
|
|
111
|
+
max-args = 8
|
|
112
|
+
|
|
113
|
+
[tool.pytest.ini_options]
|
|
114
|
+
testpaths = ["tests"]
|
|
115
|
+
addopts = "-ra --strict-markers --strict-config"
|
|
116
|
+
xfail_strict = true
|
|
117
|
+
# A ceiling, not a budget: nothing in the suite takes a minute, so a test that
|
|
118
|
+
# reaches this is hung rather than slow. tests/test_spark.py sets its own,
|
|
119
|
+
# since starting a local Spark costs seconds.
|
|
120
|
+
timeout = 600
|
|
121
|
+
filterwarnings = ["error"]
|
|
122
|
+
markers = [
|
|
123
|
+
"integration: tests that require a running Postgres instance",
|
|
124
|
+
"unmarked: plain unit tests with no other marker (applied automatically; see conftest.py)",
|
|
125
|
+
"postgres: tests that need a Postgres catalog backend (applied automatically; see conftest.py)",
|
|
126
|
+
"sqlite: tests that need a SQLite catalog backend (applied automatically; see conftest.py)",
|
|
127
|
+
"object_storage: tests that need S3/minio (applied automatically; see conftest.py)",
|
|
128
|
+
"cloud: tests that need a real GCS or Azure account (skipped unless its env var is set; see tests/test_cloud_stores.py)",
|
|
129
|
+
]
|
|
130
|
+
|
|
131
|
+
[tool.mypy]
|
|
132
|
+
python_version = "3.11"
|
|
133
|
+
files = ["src/ducklakepy", "tests"]
|
|
134
|
+
strict = true
|
|
135
|
+
warn_unreachable = true
|
|
136
|
+
ignore_missing_imports = true # pyarrow and duckdb ship no complete stubs
|
|
137
|
+
|
|
138
|
+
[[tool.mypy.overrides]]
|
|
139
|
+
module = ["ducklakepy.spark", "ducklakepy.spark.*"]
|
|
140
|
+
# pyspark is an optional extra, so a checker without it sees the Spark base
|
|
141
|
+
# classes as Any; the module is checked in full wherever pyspark is installed.
|
|
142
|
+
disallow_subclassing_any = false
|
|
143
|
+
|
|
144
|
+
[[tool.mypy.overrides]]
|
|
145
|
+
module = "tests.*"
|
|
146
|
+
# Tests are checked, not annotated to the letter: strict's untyped-def rules
|
|
147
|
+
# would only add noise to fixtures and helpers.
|
|
148
|
+
disallow_untyped_defs = false
|
|
149
|
+
disallow_incomplete_defs = false
|
|
150
|
+
disallow_untyped_calls = false
|
|
151
|
+
disallow_untyped_decorators = false
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""ducklakepy: a Python implementation of the DuckLake specification."""
|
|
2
|
+
|
|
3
|
+
from ducklakepy._version import __version__
|
|
4
|
+
from ducklakepy.catalog import DuckLakeCatalog
|
|
5
|
+
from ducklakepy.config import CatalogConfig, load_catalog
|
|
6
|
+
from ducklakepy.partitioning import PartitionKey, PartitionSpec, Transform
|
|
7
|
+
from ducklakepy.sorting import SortKey, SortOrder, asc, desc
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"CatalogConfig",
|
|
11
|
+
"DuckLakeCatalog",
|
|
12
|
+
"PartitionKey",
|
|
13
|
+
"PartitionSpec",
|
|
14
|
+
"SortKey",
|
|
15
|
+
"SortOrder",
|
|
16
|
+
"Transform",
|
|
17
|
+
"__version__",
|
|
18
|
+
"asc",
|
|
19
|
+
"desc",
|
|
20
|
+
"load_catalog",
|
|
21
|
+
]
|