pixeltable 0.2.20__tar.gz → 0.2.22__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.
Potentially problematic release.
This version of pixeltable might be problematic. Click here for more details.
- {pixeltable-0.2.20 → pixeltable-0.2.22}/PKG-INFO +50 -13
- {pixeltable-0.2.20 → pixeltable-0.2.22}/README.md +48 -11
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/__init__.py +7 -19
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/__version__.py +2 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/__init__.py +7 -7
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/column.py +37 -11
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/globals.py +21 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/insertable_table.py +6 -4
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/table.py +227 -148
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/table_version.py +66 -28
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/table_version_path.py +0 -8
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/view.py +18 -19
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/dataframe.py +16 -32
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/env.py +6 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/__init__.py +1 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/aggregation_node.py +27 -17
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/cache_prefetch_node.py +1 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/data_row_batch.py +9 -26
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/exec_node.py +36 -7
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/expr_eval_node.py +19 -11
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/in_memory_data_node.py +14 -11
- pixeltable-0.2.22/pixeltable/exec/sql_node.py +424 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/__init__.py +1 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/arithmetic_expr.py +3 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/array_slice.py +7 -7
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/column_property_ref.py +37 -10
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/column_ref.py +93 -14
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/comparison.py +5 -5
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/compound_predicate.py +8 -7
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/data_row.py +56 -36
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/expr.py +65 -63
- pixeltable-0.2.22/pixeltable/exprs/expr_dict.py +55 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/expr_set.py +26 -15
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/function_call.py +53 -24
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/globals.py +4 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/in_predicate.py +8 -7
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/inline_expr.py +4 -4
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/is_null.py +4 -4
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/json_mapper.py +11 -12
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/json_path.py +5 -10
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/literal.py +5 -5
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/method_ref.py +5 -4
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/object_ref.py +2 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/row_builder.py +88 -36
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/rowid_ref.py +14 -13
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/similarity_expr.py +12 -7
- pixeltable-0.2.22/pixeltable/exprs/sql_element_cache.py +36 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/type_cast.py +8 -6
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exprs/variable.py +5 -4
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/ext/functions/whisperx.py +7 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/aggregate_function.py +1 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/callable_function.py +2 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/function.py +11 -10
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/function_registry.py +6 -7
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/query_template_function.py +11 -12
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/signature.py +17 -15
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/udf.py +0 -4
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/__init__.py +2 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/audio.py +4 -6
- pixeltable-0.2.22/pixeltable/functions/globals.py +144 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/huggingface.py +31 -34
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/image.py +59 -45
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/json.py +0 -1
- pixeltable-0.2.22/pixeltable/functions/llama_cpp.py +106 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/mistralai.py +2 -2
- pixeltable-0.2.22/pixeltable/functions/ollama.py +147 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/openai.py +22 -25
- pixeltable-0.2.22/pixeltable/functions/replicate.py +72 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/string.py +59 -50
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/timestamp.py +20 -20
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/together.py +2 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/video.py +11 -20
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/whisper.py +2 -20
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/globals.py +65 -74
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/index/base.py +2 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/index/btree.py +20 -7
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/index/embedding_index.py +12 -14
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/io/__init__.py +1 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/io/external_store.py +11 -5
- pixeltable-0.2.22/pixeltable/io/fiftyone.py +178 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/io/globals.py +98 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/io/hf_datasets.py +1 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/io/label_studio.py +6 -6
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/io/parquet.py +14 -13
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/iterators/base.py +3 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/iterators/document.py +10 -8
- pixeltable-0.2.22/pixeltable/iterators/video.py +194 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/__init__.py +4 -3
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_14.py +4 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_15.py +1 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_19.py +1 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_20.py +1 -1
- pixeltable-0.2.22/pixeltable/metadata/converters/convert_21.py +34 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/util.py +54 -12
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/notes.py +1 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/schema.py +40 -21
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/plan.py +149 -165
- pixeltable-0.2.22/pixeltable/py.typed +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/store.py +57 -37
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/tool/create_test_db_dump.py +6 -6
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/tool/create_test_video.py +1 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/tool/doc_plugins/griffe.py +3 -34
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/tool/embed_udf.py +1 -1
- pixeltable-0.2.22/pixeltable/tool/mypy_plugin.py +55 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/type_system.py +260 -61
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/arrow.py +10 -9
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/coco.py +4 -4
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/documents.py +16 -2
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/filecache.py +9 -9
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/formatter.py +10 -11
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/http_server.py +2 -5
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/media_store.py +6 -6
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/pytorch.py +10 -11
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/sql.py +2 -1
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pyproject.toml +13 -9
- pixeltable-0.2.20/pixeltable/exec/media_validation_node.py +0 -43
- pixeltable-0.2.20/pixeltable/exec/sql_node.py +0 -296
- pixeltable-0.2.20/pixeltable/exprs/sql_element_cache.py +0 -30
- pixeltable-0.2.20/pixeltable/functions/globals.py +0 -102
- pixeltable-0.2.20/pixeltable/iterators/video.py +0 -128
- pixeltable-0.2.20/pixeltable/utils/help.py +0 -11
- {pixeltable-0.2.20 → pixeltable-0.2.22}/LICENSE +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/catalog.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/dir.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/named_function.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/path.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/path_dict.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/catalog/schema_object.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exceptions.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/component_iteration_node.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/exec_context.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/exec/row_update_node.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/ext/__init__.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/ext/functions/__init__.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/ext/functions/yolox.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/__init__.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/expr_template_function.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/func/globals.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/anthropic.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/fireworks.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/util.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/functions/vision.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/index/__init__.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/io/pandas.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/iterators/__init__.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/iterators/string.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_10.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_12.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_13.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_16.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_17.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/metadata/converters/convert_18.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/tool/doc_plugins/mkdocstrings.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/tool/doc_plugins/templates/material/udf.html.jinja +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/__init__.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/code.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/s3.py +0 -0
- {pixeltable-0.2.20 → pixeltable-0.2.22}/pixeltable/utils/transactional_directory.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pixeltable
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.22
|
|
4
4
|
Summary: Pixeltable: The Multimodal AI Data Plane
|
|
5
5
|
Author: Pixeltable, Inc.
|
|
6
6
|
Author-email: contact@pixeltable.com
|
|
@@ -16,9 +16,9 @@ Requires-Dist: cloudpickle (>=2.2.1,<3.0.0)
|
|
|
16
16
|
Requires-Dist: ftfy (>=6.2.0,<7.0.0)
|
|
17
17
|
Requires-Dist: jinja2 (>=3.1.3,<4.0.0)
|
|
18
18
|
Requires-Dist: jmespath (>=1.0.1,<2.0.0)
|
|
19
|
+
Requires-Dist: lxml (>=5.0)
|
|
19
20
|
Requires-Dist: more-itertools (>=10.2,<11.0)
|
|
20
21
|
Requires-Dist: numpy (>=1.25,<2.0)
|
|
21
|
-
Requires-Dist: opencv-python-headless (>=4.7.0.68,<5.0.0.0)
|
|
22
22
|
Requires-Dist: pandas (>=2.0,<3.0)
|
|
23
23
|
Requires-Dist: pgvector (>=0.2.1,<0.3.0)
|
|
24
24
|
Requires-Dist: pillow (>=9.3.0)
|
|
@@ -39,15 +39,19 @@ Description-Content-Type: text/markdown
|
|
|
39
39
|
<img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/source/data/pixeltable-logo-large.png" alt="Pixeltable" width="50%" />
|
|
40
40
|
<br></br>
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
](https://opensource.org/licenses/Apache-2.0)
|
|
45
|
+

|
|
46
|
+

|
|
45
47
|
<br>
|
|
46
48
|
[](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml)
|
|
47
49
|
[](https://github.com/pixeltable/pixeltable/actions/workflows/nightly.yml)
|
|
48
|
-
[](https://pypi.org/project/pixeltable/)
|
|
51
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fpixeltable%2Fpixeltable?ref=badge_shield&issueType=security)
|
|
52
|
+
<a target="_blank" href="https://huggingface.co/Pixeltable"> <img src="https://img.shields.io/badge/🤗-HF Space-FF7D04" alt="Visit our Hugging Face space"/></a>
|
|
49
53
|
|
|
50
|
-
[Installation](https://pixeltable.
|
|
54
|
+
[Installation](https://docs.pixeltable.com/docs/installation) | [Documentation](https://pixeltable.readme.io/) | [API Reference](https://pixeltable.github.io/pixeltable/) | [Code Samples](https://github.com/pixeltable/pixeltable?tab=readme-ov-file#-code-samples) | [Computer Vision](https://docs.pixeltable.com/docs/object-detection-in-videos) | [LLM](https://docs.pixeltable.com/docs/document-indexing-and-rag)
|
|
51
55
|
</div>
|
|
52
56
|
|
|
53
57
|
Pixeltable is a Python library providing a declarative interface for multimodal data (text, images, audio, video). It features built-in versioning, lineage tracking, and incremental updates, enabling users to **store**, **transform**, **index**, and **iterate** on data for their ML workflows.
|
|
@@ -73,8 +77,9 @@ Learn how to create tables, populate them with data, and enhance them with built
|
|
|
73
77
|
|:----------|:-----------------|:-------------------------|:---------------------------------:|
|
|
74
78
|
| 10-Minute Tour of Pixeltable | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/pixeltable-basics.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> | Tables and Data Operations | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/fundamentals/tables-and-data-operations.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
75
79
|
| User-Defined Functions (UDFs) | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/udfs-in-pixeltable.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> | Object Detection Models | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/object-detection-in-videos.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
76
|
-
|
|
|
77
|
-
| Integrating with Label Studio | <a target="_blank" href="https://pixeltable.readme.io/docs/label-studio"> <img src="https://img.shields.io/badge/
|
|
80
|
+
| Incremental Prompt Engineering | <a target="_blank" href="https://colab.research.google.com/github/mistralai/cookbook/blob/main/third_party/Pixeltable/incremental_prompt_engineering_and_model_comparison.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Github"/> | Working with External Files | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/working-with-external-files.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
81
|
+
| Integrating with Label Studio | <a target="_blank" href="https://pixeltable.readme.io/docs/label-studio"> <img src="https://img.shields.io/badge/Documentation-013056" alt="Visit our documentation"/></a> | Audio/Video Transcript Indexing | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/audio-transcriptions.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
82
|
+
| Multimodal Application | <a target="_blank" href="https://huggingface.co/spaces/Pixeltable/Multimodal-Powerhouse"> <img src="https://img.shields.io/badge/Hugging Face-FF7D04" alt="Visit our documentation"/></a> | Document Indexing and RAG | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/rag-demo.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
78
83
|
|
|
79
84
|
## 🧱 Code Samples
|
|
80
85
|
|
|
@@ -82,7 +87,7 @@ Learn how to create tables, populate them with data, and enhance them with built
|
|
|
82
87
|
```python
|
|
83
88
|
import pixeltable as pxt
|
|
84
89
|
|
|
85
|
-
v = pxt.create_table('external_data.videos', {'video': pxt.
|
|
90
|
+
v = pxt.create_table('external_data.videos', {'video': pxt.Video})
|
|
86
91
|
|
|
87
92
|
prefix = 's3://multimedia-commons/'
|
|
88
93
|
paths = [
|
|
@@ -100,7 +105,7 @@ import pixeltable as pxt
|
|
|
100
105
|
from pixeltable.functions import huggingface
|
|
101
106
|
|
|
102
107
|
# Create a table to store data persistently
|
|
103
|
-
t = pxt.create_table('image', {'image': pxt.
|
|
108
|
+
t = pxt.create_table('image', {'image': pxt.Image})
|
|
104
109
|
|
|
105
110
|
# Insert some images
|
|
106
111
|
prefix = 'https://upload.wikimedia.org/wikipedia/commons'
|
|
@@ -157,7 +162,7 @@ Learn how to leverage Pixeltable for [Model analytics](https://pixeltable.readme
|
|
|
157
162
|
|
|
158
163
|
### Working with inference services
|
|
159
164
|
```python
|
|
160
|
-
chat_table = pxt.create_table('together_demo.chat', {'input': pxt.
|
|
165
|
+
chat_table = pxt.create_table('together_demo.chat', {'input': pxt.String})
|
|
161
166
|
|
|
162
167
|
# The chat-completions API expects JSON-formatted input:
|
|
163
168
|
messages = [{'role': 'user', 'content': chat_table.input}]
|
|
@@ -193,7 +198,7 @@ from pixeltable.functions.huggingface import clip_image, clip_text
|
|
|
193
198
|
from pixeltable.iterators import FrameIterator
|
|
194
199
|
import PIL.Image
|
|
195
200
|
|
|
196
|
-
video_table = pxt.create_table('videos', {'video': pxt.
|
|
201
|
+
video_table = pxt.create_table('videos', {'video': pxt.Video})
|
|
197
202
|
|
|
198
203
|
video_table.insert([{'video': '/video.mp4'}])
|
|
199
204
|
|
|
@@ -224,6 +229,38 @@ frames_view.order_by(sim, asc=False).limit(5).select(frames_view.frame, sim=sim)
|
|
|
224
229
|
```
|
|
225
230
|
Learn how to work with [Embedding and Vector Indexes](https://docs.pixeltable.com/docs/embedding-vector-indexes).
|
|
226
231
|
|
|
232
|
+
## 🔄 AI Stack Comparison
|
|
233
|
+
|
|
234
|
+
### 🎯 Computer Vision Workflows
|
|
235
|
+
|
|
236
|
+
| Requirement | Traditional | Pixeltable |
|
|
237
|
+
|-------------|---------------------|------------|
|
|
238
|
+
| Frame Extraction | ffmpeg + custom code | Automatic via FrameIterator |
|
|
239
|
+
| Object Detection | Multiple scripts + caching | Single computed column |
|
|
240
|
+
| Video Indexing | Custom pipelines + Vector DB | Native similarity search |
|
|
241
|
+
| Annotation Management | Separate tools + custom code | Label Studio integration |
|
|
242
|
+
| Model Evaluation | Custom metrics pipeline | Built-in mAP computation |
|
|
243
|
+
|
|
244
|
+
### 🤖 LLM Workflows
|
|
245
|
+
|
|
246
|
+
| Requirement | Traditional | Pixeltable |
|
|
247
|
+
|-------------|---------------------|------------|
|
|
248
|
+
| Document Chunking | Tool + custom code | Native DocumentSplitter |
|
|
249
|
+
| Embedding Generation | Separate pipeline + caching | Computed columns |
|
|
250
|
+
| Vector Search | External vector DB | Built-in vector indexing |
|
|
251
|
+
| Prompt Management | Custom tracking solution | Version-controlled columns |
|
|
252
|
+
| Chain Management | Tool + custom code | Computed column DAGs |
|
|
253
|
+
|
|
254
|
+
### 🎨 Multimodal Workflows
|
|
255
|
+
|
|
256
|
+
| Requirement | Traditional | Pixeltable |
|
|
257
|
+
|-------------|---------------------|------------|
|
|
258
|
+
| Data Types | Multiple storage systems | Unified table interface |
|
|
259
|
+
| Cross-Modal Search | Complex integration | Native similarity support |
|
|
260
|
+
| Pipeline Orchestration | Multiple tools (Airflow, etc.) | Single declarative interface |
|
|
261
|
+
| Asset Management | Custom tracking system | Automatic lineage |
|
|
262
|
+
| Quality Control | Multiple validation tools | Computed validation columns |
|
|
263
|
+
|
|
227
264
|
## ❓ FAQ
|
|
228
265
|
|
|
229
266
|
### What is Pixeltable?
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
<img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/source/data/pixeltable-logo-large.png" alt="Pixeltable" width="50%" />
|
|
3
3
|
<br></br>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
](https://opensource.org/licenses/Apache-2.0)
|
|
8
|
+

|
|
9
|
+

|
|
8
10
|
<br>
|
|
9
11
|
[](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml)
|
|
10
12
|
[](https://github.com/pixeltable/pixeltable/actions/workflows/nightly.yml)
|
|
11
|
-
[](https://pypi.org/project/pixeltable/)
|
|
14
|
+
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fpixeltable%2Fpixeltable?ref=badge_shield&issueType=security)
|
|
15
|
+
<a target="_blank" href="https://huggingface.co/Pixeltable"> <img src="https://img.shields.io/badge/🤗-HF Space-FF7D04" alt="Visit our Hugging Face space"/></a>
|
|
12
16
|
|
|
13
|
-
[Installation](https://pixeltable.
|
|
17
|
+
[Installation](https://docs.pixeltable.com/docs/installation) | [Documentation](https://pixeltable.readme.io/) | [API Reference](https://pixeltable.github.io/pixeltable/) | [Code Samples](https://github.com/pixeltable/pixeltable?tab=readme-ov-file#-code-samples) | [Computer Vision](https://docs.pixeltable.com/docs/object-detection-in-videos) | [LLM](https://docs.pixeltable.com/docs/document-indexing-and-rag)
|
|
14
18
|
</div>
|
|
15
19
|
|
|
16
20
|
Pixeltable is a Python library providing a declarative interface for multimodal data (text, images, audio, video). It features built-in versioning, lineage tracking, and incremental updates, enabling users to **store**, **transform**, **index**, and **iterate** on data for their ML workflows.
|
|
@@ -36,8 +40,9 @@ Learn how to create tables, populate them with data, and enhance them with built
|
|
|
36
40
|
|:----------|:-----------------|:-------------------------|:---------------------------------:|
|
|
37
41
|
| 10-Minute Tour of Pixeltable | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/pixeltable-basics.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> | Tables and Data Operations | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/fundamentals/tables-and-data-operations.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
38
42
|
| User-Defined Functions (UDFs) | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/udfs-in-pixeltable.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> | Object Detection Models | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/object-detection-in-videos.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
39
|
-
|
|
|
40
|
-
| Integrating with Label Studio | <a target="_blank" href="https://pixeltable.readme.io/docs/label-studio"> <img src="https://img.shields.io/badge/
|
|
43
|
+
| Incremental Prompt Engineering | <a target="_blank" href="https://colab.research.google.com/github/mistralai/cookbook/blob/main/third_party/Pixeltable/incremental_prompt_engineering_and_model_comparison.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Github"/> | Working with External Files | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/working-with-external-files.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
44
|
+
| Integrating with Label Studio | <a target="_blank" href="https://pixeltable.readme.io/docs/label-studio"> <img src="https://img.shields.io/badge/Documentation-013056" alt="Visit our documentation"/></a> | Audio/Video Transcript Indexing | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/audio-transcriptions.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
45
|
+
| Multimodal Application | <a target="_blank" href="https://huggingface.co/spaces/Pixeltable/Multimodal-Powerhouse"> <img src="https://img.shields.io/badge/Hugging Face-FF7D04" alt="Visit our documentation"/></a> | Document Indexing and RAG | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/tutorials/rag-demo.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
|
|
41
46
|
|
|
42
47
|
## 🧱 Code Samples
|
|
43
48
|
|
|
@@ -45,7 +50,7 @@ Learn how to create tables, populate them with data, and enhance them with built
|
|
|
45
50
|
```python
|
|
46
51
|
import pixeltable as pxt
|
|
47
52
|
|
|
48
|
-
v = pxt.create_table('external_data.videos', {'video': pxt.
|
|
53
|
+
v = pxt.create_table('external_data.videos', {'video': pxt.Video})
|
|
49
54
|
|
|
50
55
|
prefix = 's3://multimedia-commons/'
|
|
51
56
|
paths = [
|
|
@@ -63,7 +68,7 @@ import pixeltable as pxt
|
|
|
63
68
|
from pixeltable.functions import huggingface
|
|
64
69
|
|
|
65
70
|
# Create a table to store data persistently
|
|
66
|
-
t = pxt.create_table('image', {'image': pxt.
|
|
71
|
+
t = pxt.create_table('image', {'image': pxt.Image})
|
|
67
72
|
|
|
68
73
|
# Insert some images
|
|
69
74
|
prefix = 'https://upload.wikimedia.org/wikipedia/commons'
|
|
@@ -120,7 +125,7 @@ Learn how to leverage Pixeltable for [Model analytics](https://pixeltable.readme
|
|
|
120
125
|
|
|
121
126
|
### Working with inference services
|
|
122
127
|
```python
|
|
123
|
-
chat_table = pxt.create_table('together_demo.chat', {'input': pxt.
|
|
128
|
+
chat_table = pxt.create_table('together_demo.chat', {'input': pxt.String})
|
|
124
129
|
|
|
125
130
|
# The chat-completions API expects JSON-formatted input:
|
|
126
131
|
messages = [{'role': 'user', 'content': chat_table.input}]
|
|
@@ -156,7 +161,7 @@ from pixeltable.functions.huggingface import clip_image, clip_text
|
|
|
156
161
|
from pixeltable.iterators import FrameIterator
|
|
157
162
|
import PIL.Image
|
|
158
163
|
|
|
159
|
-
video_table = pxt.create_table('videos', {'video': pxt.
|
|
164
|
+
video_table = pxt.create_table('videos', {'video': pxt.Video})
|
|
160
165
|
|
|
161
166
|
video_table.insert([{'video': '/video.mp4'}])
|
|
162
167
|
|
|
@@ -187,6 +192,38 @@ frames_view.order_by(sim, asc=False).limit(5).select(frames_view.frame, sim=sim)
|
|
|
187
192
|
```
|
|
188
193
|
Learn how to work with [Embedding and Vector Indexes](https://docs.pixeltable.com/docs/embedding-vector-indexes).
|
|
189
194
|
|
|
195
|
+
## 🔄 AI Stack Comparison
|
|
196
|
+
|
|
197
|
+
### 🎯 Computer Vision Workflows
|
|
198
|
+
|
|
199
|
+
| Requirement | Traditional | Pixeltable |
|
|
200
|
+
|-------------|---------------------|------------|
|
|
201
|
+
| Frame Extraction | ffmpeg + custom code | Automatic via FrameIterator |
|
|
202
|
+
| Object Detection | Multiple scripts + caching | Single computed column |
|
|
203
|
+
| Video Indexing | Custom pipelines + Vector DB | Native similarity search |
|
|
204
|
+
| Annotation Management | Separate tools + custom code | Label Studio integration |
|
|
205
|
+
| Model Evaluation | Custom metrics pipeline | Built-in mAP computation |
|
|
206
|
+
|
|
207
|
+
### 🤖 LLM Workflows
|
|
208
|
+
|
|
209
|
+
| Requirement | Traditional | Pixeltable |
|
|
210
|
+
|-------------|---------------------|------------|
|
|
211
|
+
| Document Chunking | Tool + custom code | Native DocumentSplitter |
|
|
212
|
+
| Embedding Generation | Separate pipeline + caching | Computed columns |
|
|
213
|
+
| Vector Search | External vector DB | Built-in vector indexing |
|
|
214
|
+
| Prompt Management | Custom tracking solution | Version-controlled columns |
|
|
215
|
+
| Chain Management | Tool + custom code | Computed column DAGs |
|
|
216
|
+
|
|
217
|
+
### 🎨 Multimodal Workflows
|
|
218
|
+
|
|
219
|
+
| Requirement | Traditional | Pixeltable |
|
|
220
|
+
|-------------|---------------------|------------|
|
|
221
|
+
| Data Types | Multiple storage systems | Unified table interface |
|
|
222
|
+
| Cross-Modal Search | Complex integration | Native similarity support |
|
|
223
|
+
| Pipeline Orchestration | Multiple tools (Airflow, etc.) | Single declarative interface |
|
|
224
|
+
| Asset Management | Custom tracking system | Automatic lineage |
|
|
225
|
+
| Quality Control | Multiple validation tools | Computed validation columns |
|
|
226
|
+
|
|
190
227
|
## ❓ FAQ
|
|
191
228
|
|
|
192
229
|
### What is Pixeltable?
|
|
@@ -1,25 +1,13 @@
|
|
|
1
|
-
from .catalog import Column, Table,
|
|
1
|
+
from .catalog import Column, InsertableTable, Table, UpdateStatus, View
|
|
2
2
|
from .dataframe import DataFrame
|
|
3
3
|
from .exceptions import Error
|
|
4
4
|
from .exprs import RELATIVE_PATH_ROOT
|
|
5
|
-
from .func import
|
|
6
|
-
from .globals import
|
|
7
|
-
|
|
8
|
-
from .type_system import (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
IntType,
|
|
12
|
-
FloatType,
|
|
13
|
-
BoolType,
|
|
14
|
-
TimestampType,
|
|
15
|
-
JsonType,
|
|
16
|
-
ArrayType,
|
|
17
|
-
ImageType,
|
|
18
|
-
VideoType,
|
|
19
|
-
AudioType,
|
|
20
|
-
DocumentType,
|
|
21
|
-
)
|
|
22
|
-
from .utils.help import help
|
|
5
|
+
from .func import Aggregator, Function, expr_udf, uda, udf
|
|
6
|
+
from .globals import (array, configure_logging, create_dir, create_table, create_view, drop_dir, drop_table, get_table,
|
|
7
|
+
init, list_dirs, list_functions, list_tables, move)
|
|
8
|
+
from .type_system import (Array, ArrayType, Audio, AudioType, Bool, BoolType, ColumnType, Document, DocumentType, Float,
|
|
9
|
+
FloatType, Image, ImageType, Int, IntType, Json, JsonType, Required, String, StringType,
|
|
10
|
+
Timestamp, TimestampType, Video, VideoType)
|
|
23
11
|
|
|
24
12
|
from . import ext, functions, io, iterators
|
|
25
13
|
from .__version__ import __version__, __version_tuple__
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
# These version placeholders will be replaced during build.
|
|
2
|
-
__version__ = "0.2.
|
|
3
|
-
__version_tuple__ = (0, 2,
|
|
2
|
+
__version__ = "0.2.22"
|
|
3
|
+
__version_tuple__ = (0, 2, 22)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
from .catalog import Catalog
|
|
2
2
|
from .column import Column
|
|
3
|
-
from .table_version_path import TableVersionPath
|
|
4
|
-
from .table_version import TableVersion
|
|
5
|
-
from .schema_object import SchemaObject
|
|
6
|
-
from .named_function import NamedFunction
|
|
7
3
|
from .dir import Dir
|
|
8
|
-
from .
|
|
4
|
+
from .globals import UpdateStatus, is_valid_identifier, is_valid_path, MediaValidation
|
|
9
5
|
from .insertable_table import InsertableTable
|
|
10
|
-
from .
|
|
6
|
+
from .named_function import NamedFunction
|
|
11
7
|
from .path import Path
|
|
12
8
|
from .path_dict import PathDict
|
|
13
|
-
from .
|
|
9
|
+
from .schema_object import SchemaObject
|
|
10
|
+
from .table import Table
|
|
11
|
+
from .table_version import TableVersion
|
|
12
|
+
from .table_version_path import TableVersionPath
|
|
13
|
+
from .view import View
|
|
@@ -8,24 +8,43 @@ import sqlalchemy as sql
|
|
|
8
8
|
import pixeltable.exceptions as excs
|
|
9
9
|
import pixeltable.type_system as ts
|
|
10
10
|
from pixeltable import exprs
|
|
11
|
-
|
|
12
|
-
from .globals import is_valid_identifier
|
|
11
|
+
from .globals import is_valid_identifier, MediaValidation
|
|
13
12
|
|
|
14
13
|
if TYPE_CHECKING:
|
|
15
14
|
from .table_version import TableVersion
|
|
16
15
|
|
|
17
16
|
_logger = logging.getLogger('pixeltable')
|
|
18
17
|
|
|
18
|
+
|
|
19
19
|
class Column:
|
|
20
20
|
"""Representation of a column in the schema of a Table/DataFrame.
|
|
21
21
|
|
|
22
22
|
A Column contains all the metadata necessary for executing queries and updates against a particular version of a
|
|
23
23
|
table/view.
|
|
24
24
|
"""
|
|
25
|
+
name: str
|
|
26
|
+
id: Optional[int]
|
|
27
|
+
col_type: ts.ColumnType
|
|
28
|
+
stored: bool
|
|
29
|
+
is_pk: bool
|
|
30
|
+
_media_validation: Optional[MediaValidation] # if not set, TableVersion.media_validation applies
|
|
31
|
+
schema_version_add: Optional[int]
|
|
32
|
+
schema_version_drop: Optional[int]
|
|
33
|
+
_records_errors: Optional[bool]
|
|
34
|
+
sa_col: Optional[sql.schema.Column]
|
|
35
|
+
sa_col_type: Optional[sql.sqltypes.TypeEngine]
|
|
36
|
+
sa_errormsg_col: Optional[sql.schema.Column]
|
|
37
|
+
sa_errortype_col: Optional[sql.schema.Column]
|
|
38
|
+
compute_func: Optional[Callable]
|
|
39
|
+
_value_expr: Optional[exprs.Expr]
|
|
40
|
+
value_expr_dict: Optional[dict[str, Any]]
|
|
41
|
+
dependent_cols: set[Column]
|
|
42
|
+
tbl: Optional[TableVersion]
|
|
43
|
+
|
|
25
44
|
def __init__(
|
|
26
45
|
self, name: Optional[str], col_type: Optional[ts.ColumnType] = None,
|
|
27
46
|
computed_with: Optional[Union[exprs.Expr, Callable]] = None,
|
|
28
|
-
is_pk: bool = False, stored: bool = True,
|
|
47
|
+
is_pk: bool = False, stored: bool = True, media_validation: Optional[MediaValidation] = None,
|
|
29
48
|
col_id: Optional[int] = None, schema_version_add: Optional[int] = None,
|
|
30
49
|
schema_version_drop: Optional[int] = None, sa_col_type: Optional[sql.sqltypes.TypeEngine] = None,
|
|
31
50
|
records_errors: Optional[bool] = None, value_expr_dict: Optional[dict[str, Any]] = None,
|
|
@@ -61,8 +80,8 @@ class Column:
|
|
|
61
80
|
if col_type is None and computed_with is None:
|
|
62
81
|
raise excs.Error(f'Column `{name}`: col_type is required if computed_with is not specified')
|
|
63
82
|
|
|
64
|
-
self._value_expr
|
|
65
|
-
self.compute_func
|
|
83
|
+
self._value_expr = None
|
|
84
|
+
self.compute_func = None
|
|
66
85
|
self.value_expr_dict = value_expr_dict
|
|
67
86
|
if computed_with is not None:
|
|
68
87
|
value_expr = exprs.Expr.from_object(computed_with)
|
|
@@ -86,24 +105,24 @@ class Column:
|
|
|
86
105
|
assert self.col_type is not None
|
|
87
106
|
|
|
88
107
|
self.stored = stored
|
|
89
|
-
self.dependent_cols
|
|
108
|
+
self.dependent_cols = set() # cols with value_exprs that reference us; set by TableVersion
|
|
90
109
|
self.id = col_id
|
|
91
110
|
self.is_pk = is_pk
|
|
111
|
+
self._media_validation = media_validation
|
|
92
112
|
self.schema_version_add = schema_version_add
|
|
93
113
|
self.schema_version_drop = schema_version_drop
|
|
94
114
|
|
|
95
115
|
self._records_errors = records_errors
|
|
96
116
|
|
|
97
117
|
# column in the stored table for the values of this Column
|
|
98
|
-
self.sa_col
|
|
118
|
+
self.sa_col = None
|
|
99
119
|
self.sa_col_type = sa_col_type
|
|
100
120
|
|
|
101
121
|
# computed cols also have storage columns for the exception string and type
|
|
102
|
-
self.sa_errormsg_col
|
|
103
|
-
self.sa_errortype_col
|
|
122
|
+
self.sa_errormsg_col = None
|
|
123
|
+
self.sa_errortype_col = None
|
|
104
124
|
|
|
105
|
-
|
|
106
|
-
self.tbl: Optional[TableVersion] = None # set by owning TableVersion
|
|
125
|
+
self.tbl = None # set by owning TableVersion
|
|
107
126
|
|
|
108
127
|
@property
|
|
109
128
|
def value_expr(self) -> Optional[exprs.Expr]:
|
|
@@ -160,6 +179,13 @@ class Column:
|
|
|
160
179
|
assert self.tbl is not None
|
|
161
180
|
return f'{self.tbl.name}.{self.name}'
|
|
162
181
|
|
|
182
|
+
@property
|
|
183
|
+
def media_validation(self) -> MediaValidation:
|
|
184
|
+
if self._media_validation is not None:
|
|
185
|
+
return self._media_validation
|
|
186
|
+
assert self.tbl is not None
|
|
187
|
+
return self.tbl.media_validation
|
|
188
|
+
|
|
163
189
|
def source(self) -> None:
|
|
164
190
|
"""
|
|
165
191
|
If this is a computed col and the top-level expr is a function call, print the source, if possible.
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
import dataclasses
|
|
3
|
+
import enum
|
|
2
4
|
import itertools
|
|
3
5
|
import logging
|
|
4
6
|
from typing import Optional
|
|
5
7
|
|
|
8
|
+
import pixeltable.exceptions as excs
|
|
9
|
+
|
|
6
10
|
_logger = logging.getLogger('pixeltable')
|
|
7
11
|
|
|
8
12
|
# name of the position column in a component view
|
|
@@ -16,6 +20,9 @@ _PREDEF_SYMBOLS: Optional[set[str]] = None
|
|
|
16
20
|
|
|
17
21
|
@dataclasses.dataclass
|
|
18
22
|
class UpdateStatus:
|
|
23
|
+
"""
|
|
24
|
+
Information about updates that resulted from a table operation.
|
|
25
|
+
"""
|
|
19
26
|
num_rows: int = 0
|
|
20
27
|
# TODO: disambiguate what this means: # of slots computed or # of columns computed?
|
|
21
28
|
num_computed_values: int = 0
|
|
@@ -31,6 +38,20 @@ class UpdateStatus:
|
|
|
31
38
|
self.cols_with_excs = list(dict.fromkeys(self.cols_with_excs + other.cols_with_excs))
|
|
32
39
|
return self
|
|
33
40
|
|
|
41
|
+
|
|
42
|
+
class MediaValidation(enum.Enum):
|
|
43
|
+
ON_READ = 0
|
|
44
|
+
ON_WRITE = 1
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def validated(cls, name: str, error_prefix: str) -> MediaValidation:
|
|
48
|
+
try:
|
|
49
|
+
return cls[name.upper()]
|
|
50
|
+
except KeyError:
|
|
51
|
+
val_strs = ', '.join(f'{s.lower()!r}' for s in cls.__members__.keys())
|
|
52
|
+
raise excs.Error(f'{error_prefix} must be one of: [{val_strs}]')
|
|
53
|
+
|
|
54
|
+
|
|
34
55
|
def is_valid_identifier(name: str) -> bool:
|
|
35
56
|
return name.isidentifier() and not name.startswith('_')
|
|
36
57
|
|
|
@@ -13,7 +13,7 @@ from pixeltable.env import Env
|
|
|
13
13
|
from pixeltable.utils.filecache import FileCache
|
|
14
14
|
|
|
15
15
|
from .catalog import Catalog
|
|
16
|
-
from .globals import UpdateStatus
|
|
16
|
+
from .globals import UpdateStatus, MediaValidation
|
|
17
17
|
from .table import Table
|
|
18
18
|
from .table_version import TableVersion
|
|
19
19
|
from .table_version_path import TableVersionPath
|
|
@@ -35,8 +35,8 @@ class InsertableTable(Table):
|
|
|
35
35
|
# MODULE-LOCAL, NOT PUBLIC
|
|
36
36
|
@classmethod
|
|
37
37
|
def _create(
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
cls, dir_id: UUID, name: str, schema: dict[str, ts.ColumnType], df: Optional[pxt.DataFrame],
|
|
39
|
+
primary_key: List[str], num_retained_versions: int, comment: str, media_validation: MediaValidation
|
|
40
40
|
) -> InsertableTable:
|
|
41
41
|
columns = cls._create_columns(schema)
|
|
42
42
|
cls._verify_schema(columns)
|
|
@@ -50,7 +50,9 @@ class InsertableTable(Table):
|
|
|
50
50
|
col.is_pk = True
|
|
51
51
|
|
|
52
52
|
with orm.Session(Env.get().engine, future=True) as session:
|
|
53
|
-
_, tbl_version = TableVersion.create(
|
|
53
|
+
_, tbl_version = TableVersion.create(
|
|
54
|
+
session, dir_id, name, columns, num_retained_versions=num_retained_versions, comment=comment,
|
|
55
|
+
media_validation=media_validation)
|
|
54
56
|
tbl = cls(dir_id, tbl_version)
|
|
55
57
|
# TODO We need to commit before doing the insertion, in order to avoid a primary key (version) collision
|
|
56
58
|
# when the table metadata gets updated. Once we have a notion of user-defined transactions in
|