pixeltable 0.2.19__py3-none-any.whl → 0.2.21__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.

Files changed (88) hide show
  1. pixeltable/__init__.py +7 -19
  2. pixeltable/__version__.py +2 -2
  3. pixeltable/catalog/__init__.py +7 -7
  4. pixeltable/catalog/globals.py +3 -0
  5. pixeltable/catalog/insertable_table.py +9 -7
  6. pixeltable/catalog/table.py +220 -143
  7. pixeltable/catalog/table_version.py +36 -18
  8. pixeltable/catalog/table_version_path.py +0 -8
  9. pixeltable/catalog/view.py +3 -3
  10. pixeltable/dataframe.py +9 -24
  11. pixeltable/env.py +107 -36
  12. pixeltable/exceptions.py +7 -4
  13. pixeltable/exec/__init__.py +1 -1
  14. pixeltable/exec/aggregation_node.py +22 -15
  15. pixeltable/exec/component_iteration_node.py +62 -41
  16. pixeltable/exec/data_row_batch.py +7 -7
  17. pixeltable/exec/exec_node.py +35 -7
  18. pixeltable/exec/expr_eval_node.py +2 -1
  19. pixeltable/exec/in_memory_data_node.py +9 -9
  20. pixeltable/exec/sql_node.py +265 -136
  21. pixeltable/exprs/__init__.py +1 -0
  22. pixeltable/exprs/data_row.py +30 -19
  23. pixeltable/exprs/expr.py +15 -14
  24. pixeltable/exprs/expr_dict.py +55 -0
  25. pixeltable/exprs/expr_set.py +21 -15
  26. pixeltable/exprs/function_call.py +21 -8
  27. pixeltable/exprs/json_path.py +3 -6
  28. pixeltable/exprs/rowid_ref.py +2 -2
  29. pixeltable/exprs/sql_element_cache.py +5 -1
  30. pixeltable/ext/functions/whisperx.py +7 -2
  31. pixeltable/func/callable_function.py +2 -2
  32. pixeltable/func/function_registry.py +6 -7
  33. pixeltable/func/query_template_function.py +11 -12
  34. pixeltable/func/signature.py +17 -15
  35. pixeltable/func/udf.py +0 -4
  36. pixeltable/functions/__init__.py +1 -1
  37. pixeltable/functions/audio.py +4 -6
  38. pixeltable/functions/globals.py +86 -42
  39. pixeltable/functions/huggingface.py +12 -14
  40. pixeltable/functions/image.py +59 -45
  41. pixeltable/functions/json.py +0 -1
  42. pixeltable/functions/mistralai.py +2 -2
  43. pixeltable/functions/openai.py +22 -25
  44. pixeltable/functions/string.py +50 -50
  45. pixeltable/functions/timestamp.py +20 -20
  46. pixeltable/functions/together.py +26 -12
  47. pixeltable/functions/video.py +11 -20
  48. pixeltable/functions/whisper.py +2 -20
  49. pixeltable/globals.py +57 -56
  50. pixeltable/index/base.py +2 -2
  51. pixeltable/index/btree.py +7 -7
  52. pixeltable/index/embedding_index.py +8 -10
  53. pixeltable/io/external_store.py +11 -5
  54. pixeltable/io/globals.py +3 -1
  55. pixeltable/io/hf_datasets.py +4 -4
  56. pixeltable/io/label_studio.py +6 -6
  57. pixeltable/io/parquet.py +14 -13
  58. pixeltable/iterators/document.py +10 -8
  59. pixeltable/iterators/video.py +10 -1
  60. pixeltable/metadata/__init__.py +3 -2
  61. pixeltable/metadata/converters/convert_14.py +4 -2
  62. pixeltable/metadata/converters/convert_15.py +1 -1
  63. pixeltable/metadata/converters/convert_19.py +1 -0
  64. pixeltable/metadata/converters/convert_20.py +1 -1
  65. pixeltable/metadata/converters/util.py +9 -8
  66. pixeltable/metadata/schema.py +32 -21
  67. pixeltable/plan.py +136 -154
  68. pixeltable/store.py +51 -36
  69. pixeltable/tool/create_test_db_dump.py +7 -7
  70. pixeltable/tool/doc_plugins/griffe.py +3 -34
  71. pixeltable/tool/mypy_plugin.py +32 -0
  72. pixeltable/type_system.py +243 -60
  73. pixeltable/utils/arrow.py +10 -9
  74. pixeltable/utils/coco.py +4 -4
  75. pixeltable/utils/documents.py +1 -1
  76. pixeltable/utils/filecache.py +131 -84
  77. pixeltable/utils/formatter.py +1 -1
  78. pixeltable/utils/http_server.py +2 -5
  79. pixeltable/utils/media_store.py +6 -6
  80. pixeltable/utils/pytorch.py +10 -11
  81. pixeltable/utils/sql.py +2 -1
  82. {pixeltable-0.2.19.dist-info → pixeltable-0.2.21.dist-info}/METADATA +16 -7
  83. pixeltable-0.2.21.dist-info/RECORD +148 -0
  84. pixeltable/utils/help.py +0 -11
  85. pixeltable-0.2.19.dist-info/RECORD +0 -147
  86. {pixeltable-0.2.19.dist-info → pixeltable-0.2.21.dist-info}/LICENSE +0 -0
  87. {pixeltable-0.2.19.dist-info → pixeltable-0.2.21.dist-info}/WHEEL +0 -0
  88. {pixeltable-0.2.19.dist-info → pixeltable-0.2.21.dist-info}/entry_points.txt +0 -0
pixeltable/__init__.py CHANGED
@@ -1,25 +1,13 @@
1
- from .catalog import Column, Table, InsertableTable, View
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 Function, udf, Aggregator, uda, expr_udf
6
- from .globals import init, create_table, create_view, get_table, move, drop_table, list_tables, create_dir, drop_dir, \
7
- list_dirs, list_functions, configure_logging, array
8
- from .type_system import (
9
- ColumnType,
10
- StringType,
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__
pixeltable/__version__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # These version placeholders will be replaced during build.
2
- __version__ = "0.2.19"
3
- __version_tuple__ = (0, 2, 19)
2
+ __version__ = "0.2.21"
3
+ __version_tuple__ = (0, 2, 21)
@@ -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 .table import Table
4
+ from .globals import UpdateStatus, is_valid_identifier, is_valid_path
9
5
  from .insertable_table import InsertableTable
10
- from .view import View
6
+ from .named_function import NamedFunction
11
7
  from .path import Path
12
8
  from .path_dict import PathDict
13
- from .globals import is_valid_identifier, is_valid_path
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
@@ -16,6 +16,9 @@ _PREDEF_SYMBOLS: Optional[set[str]] = None
16
16
 
17
17
  @dataclasses.dataclass
18
18
  class UpdateStatus:
19
+ """
20
+ Information about updates that resulted from a table operation.
21
+ """
19
22
  num_rows: int = 0
20
23
  # TODO: disambiguate what this means: # of slots computed or # of columns computed?
21
24
  num_computed_values: int = 0
@@ -10,6 +10,7 @@ import pixeltable as pxt
10
10
  import pixeltable.type_system as ts
11
11
  from pixeltable import exceptions as excs
12
12
  from pixeltable.env import Env
13
+ from pixeltable.utils.filecache import FileCache
13
14
 
14
15
  from .catalog import Catalog
15
16
  from .globals import UpdateStatus
@@ -101,21 +102,22 @@ class InsertableTable(Table):
101
102
  if not isinstance(row, dict):
102
103
  raise excs.Error('rows must be a list of dictionaries')
103
104
  self._validate_input_rows(rows)
104
- result = self._tbl_version.insert(rows, None, print_stats=print_stats, fail_on_exception=fail_on_exception)
105
+ status = self._tbl_version.insert(rows, None, print_stats=print_stats, fail_on_exception=fail_on_exception)
105
106
 
106
- if result.num_excs == 0:
107
+ if status.num_excs == 0:
107
108
  cols_with_excs_str = ''
108
109
  else:
109
110
  cols_with_excs_str = \
110
- f' across {len(result.cols_with_excs)} column{"" if len(result.cols_with_excs) == 1 else "s"}'
111
- cols_with_excs_str += f' ({", ".join(result.cols_with_excs)})'
111
+ f' across {len(status.cols_with_excs)} column{"" if len(status.cols_with_excs) == 1 else "s"}'
112
+ cols_with_excs_str += f' ({", ".join(status.cols_with_excs)})'
112
113
  msg = (
113
- f'Inserted {result.num_rows} row{"" if result.num_rows == 1 else "s"} '
114
- f'with {result.num_excs} error{"" if result.num_excs == 1 else "s"}{cols_with_excs_str}.'
114
+ f'Inserted {status.num_rows} row{"" if status.num_rows == 1 else "s"} '
115
+ f'with {status.num_excs} error{"" if status.num_excs == 1 else "s"}{cols_with_excs_str}.'
115
116
  )
116
117
  print(msg)
117
118
  _logger.info(f'InsertableTable {self._name}: {msg}')
118
- return result
119
+ FileCache.get().emit_eviction_warnings()
120
+ return status
119
121
 
120
122
  def _validate_input_rows(self, rows: List[Dict[str, Any]]) -> None:
121
123
  """Verify that the input rows match the table schema"""