pixeltable 0.2.29__py3-none-any.whl → 0.2.30__py3-none-any.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.
Potentially problematic release.
This version of pixeltable might be problematic. Click here for more details.
- pixeltable/__init__.py +1 -1
- pixeltable/__version__.py +2 -2
- pixeltable/catalog/__init__.py +1 -1
- pixeltable/catalog/globals.py +12 -0
- pixeltable/catalog/table.py +74 -14
- pixeltable/exprs/function_call.py +0 -5
- pixeltable/func/__init__.py +1 -0
- pixeltable/func/aggregate_function.py +3 -0
- pixeltable/func/callable_function.py +3 -5
- pixeltable/func/expr_template_function.py +7 -0
- pixeltable/func/function.py +11 -4
- pixeltable/func/tools.py +116 -0
- pixeltable/functions/__init__.py +2 -2
- pixeltable/functions/anthropic.py +36 -2
- pixeltable/functions/math.py +67 -0
- pixeltable/functions/openai.py +31 -2
- pixeltable/globals.py +154 -45
- pixeltable/type_system.py +12 -3
- {pixeltable-0.2.29.dist-info → pixeltable-0.2.30.dist-info}/METADATA +2 -1
- {pixeltable-0.2.29.dist-info → pixeltable-0.2.30.dist-info}/RECORD +23 -28
- pixeltable-0.2.30.dist-info/entry_points.txt +3 -0
- pixeltable/tool/create_test_db_dump.py +0 -322
- pixeltable/tool/create_test_video.py +0 -81
- pixeltable/tool/doc_plugins/griffe.py +0 -51
- pixeltable/tool/doc_plugins/mkdocstrings.py +0 -6
- pixeltable/tool/doc_plugins/templates/material/udf.html.jinja +0 -135
- pixeltable/tool/embed_udf.py +0 -9
- pixeltable/tool/mypy_plugin.py +0 -55
- pixeltable-0.2.29.dist-info/entry_points.txt +0 -3
- {pixeltable-0.2.29.dist-info → pixeltable-0.2.30.dist-info}/LICENSE +0 -0
- {pixeltable-0.2.29.dist-info → pixeltable-0.2.30.dist-info}/WHEEL +0 -0
pixeltable/globals.py
CHANGED
|
@@ -76,9 +76,9 @@ def _get_or_drop_existing_path(
|
|
|
76
76
|
# Any errors during drop will be raised.
|
|
77
77
|
_logger.info(f"Dropping {obj_type_str} `{path_str}` to replace it.")
|
|
78
78
|
if isinstance(existing_path, catalog.Dir):
|
|
79
|
-
drop_dir(path_str, force=True
|
|
79
|
+
drop_dir(path_str, force=True)
|
|
80
80
|
else:
|
|
81
|
-
drop_table(path_str, force=True
|
|
81
|
+
drop_table(path_str, force=True)
|
|
82
82
|
assert cat.paths.get_object(path) is None
|
|
83
83
|
|
|
84
84
|
return None
|
|
@@ -104,25 +104,28 @@ def create_table(
|
|
|
104
104
|
num_retained_versions: Number of versions of the table to retain.
|
|
105
105
|
comment: An optional comment; its meaning is user-defined.
|
|
106
106
|
media_validation: Media validation policy for the table.
|
|
107
|
+
|
|
107
108
|
- `'on_read'`: validate media files at query time
|
|
108
109
|
- `'on_write'`: validate media files during insert/update operations
|
|
109
110
|
if_exists: Directive regarding how to handle if the path already exists.
|
|
110
111
|
Must be one of the following:
|
|
112
|
+
|
|
111
113
|
- `'error'`: raise an error
|
|
112
114
|
- `'ignore'`: do nothing and return the existing table handle
|
|
113
115
|
- `'replace'`: if the existing table has no views, drop and replace it with a new one
|
|
114
116
|
- `'replace_force'`: drop the existing table and all its views, and create a new one
|
|
115
|
-
Default is `'error'`.
|
|
116
117
|
|
|
117
118
|
Returns:
|
|
118
119
|
A handle to the newly created table, or to an already existing table at the path when `if_exists='ignore'`.
|
|
119
|
-
|
|
120
|
+
Please note the schema of the existing table may not match the schema provided in the call.
|
|
120
121
|
|
|
121
122
|
Raises:
|
|
122
|
-
Error: if
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
Error: if
|
|
124
|
+
|
|
125
|
+
- the path is invalid, or
|
|
126
|
+
- the path already exists and `if_exists='error'`, or
|
|
127
|
+
- the path already exists and is not a table, or
|
|
128
|
+
- an error occurs while attempting to create the table.
|
|
126
129
|
|
|
127
130
|
Examples:
|
|
128
131
|
Create a table with an int and a string column:
|
|
@@ -216,15 +219,16 @@ def create_view(
|
|
|
216
219
|
num_retained_versions: Number of versions of the view to retain.
|
|
217
220
|
comment: Optional comment for the view.
|
|
218
221
|
media_validation: Media validation policy for the view.
|
|
222
|
+
|
|
219
223
|
- `'on_read'`: validate media files at query time
|
|
220
224
|
- `'on_write'`: validate media files during insert/update operations
|
|
221
225
|
if_exists: Directive regarding how to handle if the path already exists.
|
|
222
226
|
Must be one of the following:
|
|
227
|
+
|
|
223
228
|
- `'error'`: raise an error
|
|
224
229
|
- `'ignore'`: do nothing and return the existing view handle
|
|
225
230
|
- `'replace'`: if the existing view has no dependents, drop and replace it with a new one
|
|
226
231
|
- `'replace_force'`: drop the existing view and all its dependents, and create a new one
|
|
227
|
-
Default is `'error'`.
|
|
228
232
|
|
|
229
233
|
Returns:
|
|
230
234
|
A handle to the [`Table`][pixeltable.Table] representing the newly created view. If the path already
|
|
@@ -232,10 +236,12 @@ def create_view(
|
|
|
232
236
|
or the base of the existing view may not match those provided in the call.
|
|
233
237
|
|
|
234
238
|
Raises:
|
|
235
|
-
Error: if
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
+
Error: if
|
|
240
|
+
|
|
241
|
+
- the path is invalid, or
|
|
242
|
+
- the path already exists and `if_exists='error'`, or
|
|
243
|
+
- the path already exists and is not a view, or
|
|
244
|
+
- an error occurs while attempting to create the view.
|
|
239
245
|
|
|
240
246
|
Examples:
|
|
241
247
|
Create a view `my_view` of an existing table `my_table`, filtering on rows where `col1` is greater than 10:
|
|
@@ -325,25 +331,28 @@ def create_snapshot(
|
|
|
325
331
|
num_retained_versions: Number of versions of the view to retain.
|
|
326
332
|
comment: Optional comment for the snapshot.
|
|
327
333
|
media_validation: Media validation policy for the snapshot.
|
|
334
|
+
|
|
328
335
|
- `'on_read'`: validate media files at query time
|
|
329
336
|
- `'on_write'`: validate media files during insert/update operations
|
|
330
337
|
if_exists: Directive regarding how to handle if the path already exists.
|
|
331
338
|
Must be one of the following:
|
|
339
|
+
|
|
332
340
|
- `'error'`: raise an error
|
|
333
341
|
- `'ignore'`: do nothing and return the existing snapshot handle
|
|
334
342
|
- `'replace'`: if the existing snapshot has no dependents, drop and replace it with a new one
|
|
335
343
|
- `'replace_force'`: drop the existing snapshot and all its dependents, and create a new one
|
|
336
|
-
Default is `'error'`.
|
|
337
344
|
|
|
338
345
|
Returns:
|
|
339
346
|
A handle to the [`Table`][pixeltable.Table] representing the newly created snapshot.
|
|
340
|
-
|
|
347
|
+
Please note the schema or base of the existing snapshot may not match those provided in the call.
|
|
341
348
|
|
|
342
349
|
Raises:
|
|
343
|
-
Error: if
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
350
|
+
Error: if
|
|
351
|
+
|
|
352
|
+
- the path is invalid, or
|
|
353
|
+
- the path already exists and `if_exists='error'`, or
|
|
354
|
+
- the path already exists and is not a snapshot, or
|
|
355
|
+
- an error occurs while attempting to create the snapshot.
|
|
347
356
|
|
|
348
357
|
Examples:
|
|
349
358
|
Create a snapshot `my_snapshot` of a table `my_table`:
|
|
@@ -436,16 +445,26 @@ def move(path: str, new_path: str) -> None:
|
|
|
436
445
|
obj._move(new_p.name, new_dir._id)
|
|
437
446
|
|
|
438
447
|
|
|
439
|
-
def drop_table(table: Union[str, catalog.Table], force: bool = False,
|
|
448
|
+
def drop_table(table: Union[str, catalog.Table], force: bool = False,
|
|
449
|
+
if_not_exists: Literal['error', 'ignore'] = 'error') -> None:
|
|
440
450
|
"""Drop a table, view, or snapshot.
|
|
441
451
|
|
|
442
452
|
Args:
|
|
443
453
|
table: Fully qualified name, or handle, of the table to be dropped.
|
|
444
454
|
force: If `True`, will also drop all views and sub-views of this table.
|
|
445
|
-
|
|
455
|
+
if_not_exists: Directive regarding how to handle if the path does not exist.
|
|
456
|
+
Must be one of the following:
|
|
457
|
+
|
|
458
|
+
- `'error'`: raise an error
|
|
459
|
+
- `'ignore'`: do nothing and return
|
|
446
460
|
|
|
447
461
|
Raises:
|
|
448
|
-
Error:
|
|
462
|
+
Error: if the qualified name
|
|
463
|
+
|
|
464
|
+
- is invalid, or
|
|
465
|
+
- does not exist and `if_not_exists='error'`, or
|
|
466
|
+
- does not designate a table object, or
|
|
467
|
+
- designates a table object but has dependents and `force=False`.
|
|
449
468
|
|
|
450
469
|
Examples:
|
|
451
470
|
Drop a table by its fully qualified name:
|
|
@@ -455,19 +474,25 @@ def drop_table(table: Union[str, catalog.Table], force: bool = False, ignore_err
|
|
|
455
474
|
>>> t = pxt.get_table('subdir.my_table')
|
|
456
475
|
... pxt.drop_table(t)
|
|
457
476
|
|
|
477
|
+
Drop a table if it exists, otherwise do nothing:
|
|
478
|
+
>>> pxt.drop_table('subdir.my_table', if_not_exists='ignore')
|
|
479
|
+
|
|
480
|
+
Drop a table and all its dependents:
|
|
481
|
+
>>> pxt.drop_table('subdir.my_table', force=True)
|
|
458
482
|
"""
|
|
459
483
|
cat = Catalog.get()
|
|
460
484
|
if isinstance(table, str):
|
|
461
485
|
tbl_path_obj = catalog.Path(table)
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
if
|
|
486
|
+
tbl = cat.paths.get_object(tbl_path_obj)
|
|
487
|
+
if tbl is None:
|
|
488
|
+
_if_not_exists = catalog.IfNotExistsParam.validated(if_not_exists, 'if_not_exists')
|
|
489
|
+
if _if_not_exists == catalog.IfNotExistsParam.IGNORE or force:
|
|
466
490
|
_logger.info(f'Skipped table `{table}` (does not exist).')
|
|
467
491
|
return
|
|
468
492
|
else:
|
|
469
|
-
raise
|
|
470
|
-
tbl
|
|
493
|
+
raise excs.Error(f'Table `{table}` does not exist.')
|
|
494
|
+
if not isinstance(tbl, catalog.Table):
|
|
495
|
+
raise excs.Error(f'{tbl} needs to be a {catalog.Table._display_name()} but is a {type(tbl)._display_name()}')
|
|
471
496
|
else:
|
|
472
497
|
tbl = table
|
|
473
498
|
tbl_path_obj = catalog.Path(tbl._path)
|
|
@@ -520,21 +545,23 @@ def create_dir(path_str: str, if_exists: Literal['error', 'ignore', 'replace', '
|
|
|
520
545
|
path_str: Path to the directory.
|
|
521
546
|
if_exists: Directive regarding how to handle if the path already exists.
|
|
522
547
|
Must be one of the following:
|
|
548
|
+
|
|
523
549
|
- `'error'`: raise an error
|
|
524
550
|
- `'ignore'`: do nothing and return the existing directory handle
|
|
525
551
|
- `'replace'`: if the existing directory is empty, drop it and create a new one
|
|
526
552
|
- `'replace_force'`: drop the existing directory and all its children, and create a new one
|
|
527
|
-
Default is `'error'`.
|
|
528
553
|
|
|
529
554
|
Returns:
|
|
530
555
|
A handle to the newly created directory, or to an already existing directory at the path when `if_exists='ignore'`.
|
|
531
|
-
|
|
556
|
+
Please note the existing directory may not be empty.
|
|
532
557
|
|
|
533
558
|
Raises:
|
|
534
|
-
Error: If
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
559
|
+
Error: If
|
|
560
|
+
|
|
561
|
+
- the path is invalid, or
|
|
562
|
+
- the path already exists and `if_exists='error'`, or
|
|
563
|
+
- the path already exists and is not a directory, or
|
|
564
|
+
- an error occurs while attempting to create the directory.
|
|
538
565
|
|
|
539
566
|
Examples:
|
|
540
567
|
>>> pxt.create_dir('my_dir')
|
|
@@ -578,37 +605,57 @@ def create_dir(path_str: str, if_exists: Literal['error', 'ignore', 'replace', '
|
|
|
578
605
|
print(f'Created directory `{path_str}`.')
|
|
579
606
|
return dir
|
|
580
607
|
|
|
581
|
-
def drop_dir(path_str: str, force: bool = False,
|
|
608
|
+
def drop_dir(path_str: str, force: bool = False, if_not_exists: Literal['error', 'ignore'] = 'error') -> None:
|
|
582
609
|
"""Remove a directory.
|
|
583
610
|
|
|
584
611
|
Args:
|
|
585
612
|
path_str: Name or path of the directory.
|
|
586
613
|
force: If `True`, will also drop all tables and subdirectories of this directory, recursively, along
|
|
587
614
|
with any views or snapshots that depend on any of the dropped tables.
|
|
588
|
-
|
|
589
|
-
|
|
615
|
+
if_not_exists: Directive regarding how to handle if the path does not exist.
|
|
616
|
+
Must be one of the following:
|
|
617
|
+
|
|
618
|
+
- `'error'`: raise an error
|
|
619
|
+
- `'ignore'`: do nothing and return
|
|
590
620
|
|
|
591
621
|
Raises:
|
|
592
|
-
Error: If the path
|
|
622
|
+
Error: If the path
|
|
623
|
+
|
|
624
|
+
- is invalid, or
|
|
625
|
+
- does not exist and `if_not_exists='error'`, or
|
|
626
|
+
- is not designate a directory, or
|
|
627
|
+
- is a direcotory but is not empty and `force=False`.
|
|
593
628
|
|
|
594
629
|
Examples:
|
|
630
|
+
Remove a directory, if it exists and is empty:
|
|
595
631
|
>>> pxt.drop_dir('my_dir')
|
|
596
632
|
|
|
597
633
|
Remove a subdirectory:
|
|
598
634
|
|
|
599
635
|
>>> pxt.drop_dir('my_dir.sub_dir')
|
|
636
|
+
|
|
637
|
+
Remove an existing directory if it is empty, but do nothing if it does not exist:
|
|
638
|
+
|
|
639
|
+
>>> pxt.drop_dir('my_dir.sub_dir', if_not_exists='ignore')
|
|
640
|
+
|
|
641
|
+
Remove an existing directory and all its contents:
|
|
642
|
+
|
|
643
|
+
>>> pxt.drop_dir('my_dir', force=True)
|
|
600
644
|
"""
|
|
601
645
|
cat = Catalog.get()
|
|
602
646
|
path = catalog.Path(path_str)
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
_logger.info(f'Skipped directory `{path}` (does not exist).')
|
|
647
|
+
obj = cat.paths.get_object(path)
|
|
648
|
+
if obj is None:
|
|
649
|
+
_if_not_exists = catalog.IfNotExistsParam.validated(if_not_exists, 'if_not_exists')
|
|
650
|
+
if _if_not_exists == catalog.IfNotExistsParam.IGNORE or force:
|
|
651
|
+
_logger.info(f'Skipped directory `{path_str}` (does not exist).')
|
|
609
652
|
return
|
|
610
653
|
else:
|
|
611
|
-
raise
|
|
654
|
+
raise excs.Error(f'Directory `{path_str}` does not exist.')
|
|
655
|
+
|
|
656
|
+
if not isinstance(obj, catalog.Dir):
|
|
657
|
+
raise excs.Error(
|
|
658
|
+
f'{str(path)} needs to be a {catalog.Dir._display_name()} but is a {type(obj)._display_name()}')
|
|
612
659
|
|
|
613
660
|
children = cat.paths.get_children(path, child_type=None, recursive=True)
|
|
614
661
|
|
|
@@ -686,6 +733,68 @@ def list_functions() -> Styler:
|
|
|
686
733
|
return pd_df.hide(axis='index')
|
|
687
734
|
|
|
688
735
|
|
|
736
|
+
def tools(*args: Union[func.Function, func.tools.Tool]) -> func.tools.Tools:
|
|
737
|
+
"""
|
|
738
|
+
Specifies a collection of UDFs to be used as LLM tools. Pixeltable allows any UDF to be used as an input into an
|
|
739
|
+
LLM tool-calling API. To use one or more UDFs as tools, wrap them in a `pxt.tools` call and pass the return value
|
|
740
|
+
to an LLM API.
|
|
741
|
+
|
|
742
|
+
The UDFs can be specified directly or wrapped inside a [pxt.tool()][pixeltable.tool] invocation. If a UDF is
|
|
743
|
+
specified directly, the tool name will be the (unqualified) UDF name, and the tool description will consist of the
|
|
744
|
+
entire contents of the UDF docstring. If a UDF is wrapped in a `pxt.tool()` invocation, then the name and/or
|
|
745
|
+
description may be customized.
|
|
746
|
+
|
|
747
|
+
Args:
|
|
748
|
+
args: The UDFs to use as tools.
|
|
749
|
+
|
|
750
|
+
Returns:
|
|
751
|
+
A `Tools` instance that can be passed to an LLM tool-calling API or invoked to generate tool results.
|
|
752
|
+
|
|
753
|
+
Examples:
|
|
754
|
+
Create a tools instance with a single UDF:
|
|
755
|
+
|
|
756
|
+
>>> tools = pxt.tools(stock_price)
|
|
757
|
+
|
|
758
|
+
Create a tools instance with several UDFs:
|
|
759
|
+
|
|
760
|
+
>>> tools = pxt.tools(stock_price, weather_quote)
|
|
761
|
+
|
|
762
|
+
Create a tools instance, some of whose UDFs have customized metadata:
|
|
763
|
+
|
|
764
|
+
>>> tools = pxt.tools(
|
|
765
|
+
... stock_price,
|
|
766
|
+
... pxt.tool(weather_quote, description='Returns information about the weather in a particular location.'),
|
|
767
|
+
... pxt.tool(traffic_quote, name='traffic_conditions'),
|
|
768
|
+
... )
|
|
769
|
+
"""
|
|
770
|
+
return func.tools.Tools(tools=[
|
|
771
|
+
arg if isinstance(arg, func.tools.Tool) else tool(arg)
|
|
772
|
+
for arg in args
|
|
773
|
+
])
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
def tool(fn: func.Function, name: Optional[str] = None, description: Optional[str] = None) -> func.tools.Tool:
|
|
777
|
+
"""
|
|
778
|
+
Specifies a Pixeltable UDF to be used as an LLM tool with customizable metadata. See the documentation for
|
|
779
|
+
[pxt.tools()][pixeltable.tools] for more details.
|
|
780
|
+
|
|
781
|
+
Args:
|
|
782
|
+
fn: The UDF to use as a tool.
|
|
783
|
+
name: The name of the tool. If not specified, then the unqualified name of the UDF will be used by default.
|
|
784
|
+
description: The description of the tool. If not specified, then the entire contents of the UDF docstring
|
|
785
|
+
will be used by default.
|
|
786
|
+
|
|
787
|
+
Returns:
|
|
788
|
+
A `Tool` instance that can be passed to an LLM tool-calling API.
|
|
789
|
+
"""
|
|
790
|
+
if fn.self_path is None:
|
|
791
|
+
raise excs.Error('Only module UDFs can be used as tools (not locally defined UDFs)')
|
|
792
|
+
if isinstance(fn, func.AggregateFunction):
|
|
793
|
+
raise excs.Error('Aggregator UDFs cannot be used as tools')
|
|
794
|
+
|
|
795
|
+
return func.tools.Tool(fn=fn, name=name, description=description)
|
|
796
|
+
|
|
797
|
+
|
|
689
798
|
def configure_logging(
|
|
690
799
|
*,
|
|
691
800
|
to_stdout: Optional[bool] = None,
|
pixeltable/type_system.py
CHANGED
|
@@ -17,6 +17,7 @@ import jsonschema
|
|
|
17
17
|
import jsonschema.protocols
|
|
18
18
|
import jsonschema.validators
|
|
19
19
|
import numpy as np
|
|
20
|
+
import pydantic
|
|
20
21
|
import sqlalchemy as sql
|
|
21
22
|
from typing import _GenericAlias # type: ignore[attr-defined]
|
|
22
23
|
from typing_extensions import _AnnotatedAlias
|
|
@@ -246,7 +247,7 @@ class ColumnType:
|
|
|
246
247
|
if col_type is not None:
|
|
247
248
|
return col_type
|
|
248
249
|
# this could still be json-serializable
|
|
249
|
-
if isinstance(val, dict) or isinstance(val, list) or isinstance(val, np.ndarray):
|
|
250
|
+
if isinstance(val, dict) or isinstance(val, list) or isinstance(val, np.ndarray) or isinstance(val, pydantic.BaseModel):
|
|
250
251
|
try:
|
|
251
252
|
JsonType().validate_literal(val)
|
|
252
253
|
return JsonType(nullable=nullable)
|
|
@@ -339,7 +340,7 @@ class ColumnType:
|
|
|
339
340
|
return TimestampType(nullable=nullable_default)
|
|
340
341
|
if t is PIL.Image.Image:
|
|
341
342
|
return ImageType(nullable=nullable_default)
|
|
342
|
-
if issubclass(t, Sequence) or issubclass(t, Mapping):
|
|
343
|
+
if issubclass(t, Sequence) or issubclass(t, Mapping) or issubclass(t, pydantic.BaseModel):
|
|
343
344
|
return JsonType(nullable=nullable_default)
|
|
344
345
|
return None
|
|
345
346
|
|
|
@@ -658,7 +659,7 @@ class JsonType(ColumnType):
|
|
|
658
659
|
return val_type.print_value(val)
|
|
659
660
|
|
|
660
661
|
def _validate_literal(self, val: Any) -> None:
|
|
661
|
-
if not isinstance(val, dict
|
|
662
|
+
if not isinstance(val, (dict, list)):
|
|
662
663
|
# TODO In the future we should accept scalars too, which would enable us to remove this top-level check
|
|
663
664
|
raise TypeError(f'Expected dict or list, got {val.__class__.__name__}')
|
|
664
665
|
if not self.__is_valid_json(val):
|
|
@@ -679,6 +680,8 @@ class JsonType(ColumnType):
|
|
|
679
680
|
def _create_literal(self, val: Any) -> Any:
|
|
680
681
|
if isinstance(val, tuple):
|
|
681
682
|
val = list(val)
|
|
683
|
+
if isinstance(val, pydantic.BaseModel):
|
|
684
|
+
return val.model_dump()
|
|
682
685
|
return val
|
|
683
686
|
|
|
684
687
|
def supertype(self, other: ColumnType) -> Optional[JsonType]:
|
|
@@ -868,6 +871,12 @@ class ArrayType(ColumnType):
|
|
|
868
871
|
return False
|
|
869
872
|
return val.dtype == self.numpy_dtype()
|
|
870
873
|
|
|
874
|
+
def _to_json_schema(self) -> dict[str, Any]:
|
|
875
|
+
return {
|
|
876
|
+
'type': 'array',
|
|
877
|
+
'items': self.pxt_dtype._to_json_schema(),
|
|
878
|
+
}
|
|
879
|
+
|
|
871
880
|
def _validate_literal(self, val: Any) -> None:
|
|
872
881
|
if not isinstance(val, np.ndarray):
|
|
873
882
|
raise TypeError(f'Expected numpy.ndarray, got {val.__class__.__name__}')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pixeltable
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.30
|
|
4
4
|
Summary: AI Data Infrastructure: Declarative, Multimodal, and Incremental
|
|
5
5
|
Home-page: https://pixeltable.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -40,6 +40,7 @@ Requires-Dist: pixeltable-pgserver (==0.2.9)
|
|
|
40
40
|
Requires-Dist: psutil (>=5.9.5,<6.0.0)
|
|
41
41
|
Requires-Dist: psycopg[binary] (>=3.1.18)
|
|
42
42
|
Requires-Dist: puremagic (>=1.20)
|
|
43
|
+
Requires-Dist: pydantic (>=2.7.4)
|
|
43
44
|
Requires-Dist: pymupdf (>=1.24.1,<2.0.0)
|
|
44
45
|
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
45
46
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
pixeltable/__init__.py,sha256=
|
|
2
|
-
pixeltable/__version__.py,sha256=
|
|
3
|
-
pixeltable/catalog/__init__.py,sha256=
|
|
1
|
+
pixeltable/__init__.py,sha256=A711Bh7Ew071NB80_QB-G8U3MCzE8c_Eie4Eze5oTU0,1404
|
|
2
|
+
pixeltable/__version__.py,sha256=KcLib9jD_4YKaDT35NWGIWWIsVEcFCuYxeR4qAISynA,114
|
|
3
|
+
pixeltable/catalog/__init__.py,sha256=u8Ods4ncTY7DI5w0jyHVC0QDVDLHAy8Rqia3qsM5OH8,517
|
|
4
4
|
pixeltable/catalog/catalog.py,sha256=tyDyI5wQw7vV6_FChrp9qgGCRClcjiSdW3eygYT0p9s,7849
|
|
5
5
|
pixeltable/catalog/column.py,sha256=ezeKoGl6aBTzSZBihDA6vdETcvyCguAD4OsmrxWs73A,9595
|
|
6
6
|
pixeltable/catalog/dir.py,sha256=-dV0-gn5GfqRmVIJbuUBOXqPuNLDm219cud_kBTNzuk,1203
|
|
7
|
-
pixeltable/catalog/globals.py,sha256=
|
|
7
|
+
pixeltable/catalog/globals.py,sha256=VgcmwtKYYDQtvtHShVde52n4FzGBtAIFYxoS-WD7OBw,3242
|
|
8
8
|
pixeltable/catalog/insertable_table.py,sha256=hOsdYhkhtRcDOrRkweIGFUfjweWF3fLUErkUTlGYoSU,7172
|
|
9
9
|
pixeltable/catalog/named_function.py,sha256=cWf9WxAagSY9uqE7mM0IwWSsDOvQUkJlcHlGqgVciJg,1225
|
|
10
10
|
pixeltable/catalog/path.py,sha256=QgccEi_QOfaKt8YsR2zLtd_z7z7QQkU_1kprJFi2SPQ,1677
|
|
11
11
|
pixeltable/catalog/path_dict.py,sha256=V7YQM0QhUWr4FbgUiDUIweGbmMJr687QCm2p614Xrs0,6473
|
|
12
12
|
pixeltable/catalog/schema_object.py,sha256=NUE6Fx6Km0UUJ6WcE9mOgL2UQCLBMQjINQLp_mljzKA,2382
|
|
13
|
-
pixeltable/catalog/table.py,sha256=
|
|
13
|
+
pixeltable/catalog/table.py,sha256=ePJkkQnQIthCFhsxtH2HU-gbefduJt54l-OV_fWAv7I,58738
|
|
14
14
|
pixeltable/catalog/table_version.py,sha256=hbnAtd-0EsVFCuWE1yrmm_CLar6NNQDRevgDjduh2CY,58581
|
|
15
15
|
pixeltable/catalog/table_version_path.py,sha256=CczGbcz5ESq663arreri_p4chMZHozgG6k3y-ajkJN4,5787
|
|
16
16
|
pixeltable/catalog/view.py,sha256=mJbaVE63GaBDy7EcQkQ2q5NKlrHlGyENkRyQVzU-ak8,10854
|
|
@@ -39,7 +39,7 @@ pixeltable/exprs/data_row.py,sha256=rLtKxlst9mK6684A5y-nsjBcalyKEcKAWcYCtNpK10w,
|
|
|
39
39
|
pixeltable/exprs/expr.py,sha256=E1V_fU1qA4nkHLHTqGkxr8exJE6I9-b9LwNVXxGNTXo,30463
|
|
40
40
|
pixeltable/exprs/expr_dict.py,sha256=xkvo_iVPOLMq3WkBZQ2FOoXqYoebuV6XGlidPJxdOkY,1588
|
|
41
41
|
pixeltable/exprs/expr_set.py,sha256=GeUQXadzJbAqQOGdsO6Z5hPAp0A03YUr2hyIvfZDYEE,2576
|
|
42
|
-
pixeltable/exprs/function_call.py,sha256=
|
|
42
|
+
pixeltable/exprs/function_call.py,sha256=5lMTj4G6jOarabZ0b3xpgAMJe3rgDdCSXbYwnrZEjxs,26196
|
|
43
43
|
pixeltable/exprs/globals.py,sha256=5pwn5vdi-EEpYBpPty658YV45myY7W0iFIfTH7QIzak,2032
|
|
44
44
|
pixeltable/exprs/in_predicate.py,sha256=VxSn9TA_3UDHTC6rqQ12No5HbZO7SuE4DglpwAoI58s,3783
|
|
45
45
|
pixeltable/exprs/inline_expr.py,sha256=oALVAM5BVFskEQgkfgGIhKFm6V2FUlrPtocGtqtXM0w,7867
|
|
@@ -59,18 +59,19 @@ pixeltable/ext/__init__.py,sha256=iO0J_Jfnv38F5y40sDAW54gpXjIyZgOGgoWQJAwjQec,42
|
|
|
59
59
|
pixeltable/ext/functions/__init__.py,sha256=hIjPEKC5E5uJOXlQqUyhP9yn9ZqWOCJAlj0kXWDlhlE,159
|
|
60
60
|
pixeltable/ext/functions/whisperx.py,sha256=jojjNhazcYiAh1scwUl-erhIDRr4kOTkcLrjy0xcp6g,2325
|
|
61
61
|
pixeltable/ext/functions/yolox.py,sha256=k-pQTelv4Tea3AXvDB7Kc7YCIa1uexjVGqxETP0B_hc,5351
|
|
62
|
-
pixeltable/func/__init__.py,sha256=
|
|
63
|
-
pixeltable/func/aggregate_function.py,sha256=
|
|
64
|
-
pixeltable/func/callable_function.py,sha256=
|
|
65
|
-
pixeltable/func/expr_template_function.py,sha256=
|
|
66
|
-
pixeltable/func/function.py,sha256=
|
|
62
|
+
pixeltable/func/__init__.py,sha256=o2UZs6nKwV_wovGQT-lrtETHj9ZOB7ygqaNmX19oXdA,438
|
|
63
|
+
pixeltable/func/aggregate_function.py,sha256=SWqU3stHBzrZbzoNCNHBhMHqQbT9rpVTelWY6otboSg,12649
|
|
64
|
+
pixeltable/func/callable_function.py,sha256=Dq2Az5VtP7HNYZsecdDPSfhGAm-4py9G_3rP_L9mxlA,6609
|
|
65
|
+
pixeltable/func/expr_template_function.py,sha256=xoi7yngicX4F_-qa64a38_dvX3Bs_4BDphodTEul06o,5381
|
|
66
|
+
pixeltable/func/function.py,sha256=e1QjaOTU0hGDjuyDaRVVOdpyGhokcsZajRTqhibtX2U,16811
|
|
67
67
|
pixeltable/func/function_registry.py,sha256=Ps09iPDRJRKj-NQtancrI07zqFBIPpASGZ636mpBiI0,12333
|
|
68
68
|
pixeltable/func/globals.py,sha256=sEwn6lGgHMp6VQORb_P5qRd_-Q2_bUSqvqM9-XPN_ec,1483
|
|
69
69
|
pixeltable/func/query_template_function.py,sha256=PngD4THjiQz816MPjeOFIvqhJ0mb5y3YGNh4Zv1Xr4Q,3766
|
|
70
70
|
pixeltable/func/signature.py,sha256=wWf07OawOwDmqZOjUPgHJHAhAQ-fd61PGBx82aWLBgA,11212
|
|
71
|
+
pixeltable/func/tools.py,sha256=CqadtWd17sib9zm7XPGDNOCG4-Ai-hGPFYTCZgjkoSY,4690
|
|
71
72
|
pixeltable/func/udf.py,sha256=a8FqOcDqPvUICvELpPOQVsrvr0sgZBQuV4aVHXuexac,8603
|
|
72
|
-
pixeltable/functions/__init__.py,sha256=
|
|
73
|
-
pixeltable/functions/anthropic.py,sha256=
|
|
73
|
+
pixeltable/functions/__init__.py,sha256=2vdpJ3S1pUle8dBzCVM70o8Lj1c0lgccZPJgPYms_CQ,403
|
|
74
|
+
pixeltable/functions/anthropic.py,sha256=k80_oGuVXFn0_DjccExw8QWkwi5uutlkeqZ7k77iG8M,4198
|
|
74
75
|
pixeltable/functions/audio.py,sha256=7213nTnqKJ6vM9kalaoJ283OwX5SGEJN10vDhaRNZ6E,644
|
|
75
76
|
pixeltable/functions/fireworks.py,sha256=qwFC_eIaDs-glxyJ_IVXaNGkpgPzeRsQ_SdpzueBxq0,2605
|
|
76
77
|
pixeltable/functions/gemini.py,sha256=RQ3I25nXSXUXdF0rmhnv5XOgZXb_6SIgMc_hEyF83SI,2783
|
|
@@ -79,9 +80,10 @@ pixeltable/functions/huggingface.py,sha256=s5KmOfi9-TOYyrL1Wv-voKP7ykkUN7LlLAA_u
|
|
|
79
80
|
pixeltable/functions/image.py,sha256=3Qm4ybAT_o4YUl3bzhEXy8dKOwgZ7RCUV-ky-dbL_jc,13836
|
|
80
81
|
pixeltable/functions/json.py,sha256=cptFpuxQED5wSXXsH8steeHu3pCkZ_zXRE7lccjXybU,756
|
|
81
82
|
pixeltable/functions/llama_cpp.py,sha256=1awALuAXVpQH64l7vQlM8gvxLDix4c1-6DV3nG5RHu4,3881
|
|
83
|
+
pixeltable/functions/math.py,sha256=WPoH9zD9_GdwvBs-FSC3Sqb70gOPNouhPcBZABsuLwI,1541
|
|
82
84
|
pixeltable/functions/mistralai.py,sha256=GpxtT-a8ltx1kQC8XTJRflxkh-17VhzzFTkxqIUsba8,5494
|
|
83
85
|
pixeltable/functions/ollama.py,sha256=z-g0cCJ-WMf6RI3SXIVVbbOlrWNR8nxGTyzET1rratU,4320
|
|
84
|
-
pixeltable/functions/openai.py,sha256=
|
|
86
|
+
pixeltable/functions/openai.py,sha256=rro4m8k2l5UCWnBiXp63HyKkH36937raiavr9Q_nsvs,16463
|
|
85
87
|
pixeltable/functions/replicate.py,sha256=j8ZedScOMInmHWmriQSUOviw6tp8gQr-W6n21PNNL2g,2188
|
|
86
88
|
pixeltable/functions/string.py,sha256=VqzhVildxTt_XblW89Kl5Zd6MVOU71eaX2LTMY5jkUg,20366
|
|
87
89
|
pixeltable/functions/timestamp.py,sha256=KOm5eVF51PqOCTqwq8cKCAEJNWMgu2xN_yTtGf7yixU,9095
|
|
@@ -90,7 +92,7 @@ pixeltable/functions/util.py,sha256=GgKTzCjvzUQNjWtSObTkfxkvJ9GVUOzKimY45WhE25M,
|
|
|
90
92
|
pixeltable/functions/video.py,sha256=12jnOdU0G-Hk42rJx-S5QC77-bDkUflkxfkjej8n5pM,6702
|
|
91
93
|
pixeltable/functions/vision.py,sha256=MEgkNp-4tUUeQS05VEJBrMgQFM48aNsNlksfAl9rH7w,15494
|
|
92
94
|
pixeltable/functions/whisper.py,sha256=f2wqRd0n9jSBqRZN3W93UaetiAHtbsK0j9jXR2j2kkQ,2913
|
|
93
|
-
pixeltable/globals.py,sha256=
|
|
95
|
+
pixeltable/globals.py,sha256=WD4K7V2t6KDUs4VMU-SJWSpIbWeybSnOfQioYRsZGNU,33688
|
|
94
96
|
pixeltable/index/__init__.py,sha256=XBwetNQQwnz0fiKwonOKhyy_U32l_cjt77kNvEIdjWs,102
|
|
95
97
|
pixeltable/index/base.py,sha256=zo0YvJI3oXiK6hZJztB36ZftKKhLfO75Zq3t-PeQA6M,1556
|
|
96
98
|
pixeltable/index/btree.py,sha256=JFerLyyLoBaD0FSF_jJ6iJFBVa-z_et--KdNR02xjRg,2264
|
|
@@ -130,14 +132,7 @@ pixeltable/metadata/schema.py,sha256=H9t51cbhXOhNu9Xog2VTjZlkTCx4cjQAlwOXi3HSd2E
|
|
|
130
132
|
pixeltable/plan.py,sha256=dzG3iD9ClggFyIYmDuIK7H3eBC8HV3ft__f4ZULQvow,40687
|
|
131
133
|
pixeltable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
132
134
|
pixeltable/store.py,sha256=m-OeilqOFai5wUXvtXTV9txzn-GhK2lfA7fkvzrfWFg,21974
|
|
133
|
-
pixeltable/
|
|
134
|
-
pixeltable/tool/create_test_video.py,sha256=4cQmqoKjn3juy7Ilty75gWBygqBxTZ1E9XPlrsC0Ssk,2931
|
|
135
|
-
pixeltable/tool/doc_plugins/griffe.py,sha256=I-doBXaSMy9ncSJp0Ndiuh4vzPWdYCH1anX246ojWtE,2253
|
|
136
|
-
pixeltable/tool/doc_plugins/mkdocstrings.py,sha256=afq7XOaSC5WRmugkh-FMFMK8PqOgIlDIsJdD8cuPhtE,207
|
|
137
|
-
pixeltable/tool/doc_plugins/templates/material/udf.html.jinja,sha256=R-7Q57nmDd5BUea-F1-MjwjK3pq7uBHXNoSo8_QjZG4,4890
|
|
138
|
-
pixeltable/tool/embed_udf.py,sha256=EXvfvuzZm0uTgH-aAATSrKV8ixCU8OMwpzXlJMg845Y,299
|
|
139
|
-
pixeltable/tool/mypy_plugin.py,sha256=__oTFElirrK25jCX1z_asD_gxGnGxtD2TaU6r1if-Ic,1784
|
|
140
|
-
pixeltable/type_system.py,sha256=vhIjTff-6F7iLEqqp1Fh73glTL061W5_k3u6SpB7i24,48084
|
|
135
|
+
pixeltable/type_system.py,sha256=AfDZqgcMd5i1p_rlQ79-1aDpfbS6yRQCk6_feRUhJro,48399
|
|
141
136
|
pixeltable/utils/__init__.py,sha256=UYlrf6TIWJT0g-Hac0b34-dEk478B5Qx8dGco34YlIk,439
|
|
142
137
|
pixeltable/utils/arrow.py,sha256=4AyCAkkNfNChVTaPAVS5j1ZO7BtTxn11duonolfktV8,3931
|
|
143
138
|
pixeltable/utils/coco.py,sha256=WCUyoj0dTyJFbPB7frEQUvY92SlEPxQ068r-3QAwROE,7285
|
|
@@ -152,8 +147,8 @@ pixeltable/utils/pytorch.py,sha256=6RvOCjy_QV4gc-aht-3d0zoASkuv-warfpl87vgmuKw,3
|
|
|
152
147
|
pixeltable/utils/s3.py,sha256=huA5hxDGkPIu18zWet76o0FsO7Vbtp-iPmnOzCe-MvA,586
|
|
153
148
|
pixeltable/utils/sql.py,sha256=j_tj0h4ffm-DhUIJbvGphxrVyBKlNTwDKqWGhRQ5_PY,795
|
|
154
149
|
pixeltable/utils/transactional_directory.py,sha256=UGzCrGtLR3hEEf8sYGuWBzLVFAEQml3vdIavigWeTBM,1349
|
|
155
|
-
pixeltable-0.2.
|
|
156
|
-
pixeltable-0.2.
|
|
157
|
-
pixeltable-0.2.
|
|
158
|
-
pixeltable-0.2.
|
|
159
|
-
pixeltable-0.2.
|
|
150
|
+
pixeltable-0.2.30.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
151
|
+
pixeltable-0.2.30.dist-info/METADATA,sha256=tJOG6uUsIWjIrRstj2WjUSwrosTfF_2V67n4WmJ5tBE,19546
|
|
152
|
+
pixeltable-0.2.30.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
153
|
+
pixeltable-0.2.30.dist-info/entry_points.txt,sha256=ToOd-pRgG7AitEBgYoBCRRB4-KVDQ0pj_9T4a1LgwA4,97
|
|
154
|
+
pixeltable-0.2.30.dist-info/RECORD,,
|