chalkpy 2.93.4__py3-none-any.whl → 2.93.5__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.
chalk/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.93.4"
1
+ __version__ = "2.93.5"
@@ -405,10 +405,12 @@ class Feature(Generic[_TPrim, _TRich]):
405
405
 
406
406
  if offline_ttl is None:
407
407
  offline_ttl = timedelta(0)
408
+ elif offline_ttl is ...:
409
+ # Should we allow the offline_ttl to be set via the class decorator?
410
+ offline_ttl = CHALK_MAX_TIMEDELTA
408
411
  elif isinstance(offline_ttl, str):
409
412
  offline_ttl = parse_chalk_duration(offline_ttl)
410
- if offline_ttl is not ...:
411
- self.offline_ttl = offline_ttl
413
+ self.offline_ttl = offline_ttl
412
414
 
413
415
  self.cache_strategy = cache_strategy
414
416
 
@@ -179,7 +179,6 @@ class FeaturesImpl(metaclass=FeaturesMeta):
179
179
  __chalk_is_singleton__: ClassVar[bool]
180
180
  __chalk_etl_offline_to_online__: ClassVar[bool]
181
181
  __chalk_max_staleness__: ClassVar[timedelta]
182
- __chalk_offline_ttl__: ClassVar[timedelta]
183
182
  __chalk_cache_strategy__: ClassVar[CacheStrategy]
184
183
  __chalk_namespace__: ClassVar[str]
185
184
  __chalk_primary__: ClassVar[Feature | None] = None # The primary key feature
@@ -34,7 +34,7 @@ from chalk.streams import Windowed
34
34
  from chalk.streams._windows import GroupByWindowed, get_name_with_duration
35
35
  from chalk.utils import notebook
36
36
  from chalk.utils.collections import ensure_tuple
37
- from chalk.utils.duration import CHALK_MAX_TIMEDELTA, Duration, parse_chalk_duration, parse_chalk_duration_s
37
+ from chalk.utils.duration import Duration, parse_chalk_duration, parse_chalk_duration_s
38
38
  from chalk.utils.metaprogramming import MISSING, set_new_attribute
39
39
  from chalk.utils.string import to_snake_case
40
40
  from chalk.stores.online_store_config import OnlineStoreConfig
@@ -65,7 +65,6 @@ def features(
65
65
  singleton: bool = False,
66
66
  cache_nulls: CacheNullsType = True,
67
67
  cache_defaults: CacheDefaultsType = True,
68
- offline_ttl: Optional[Duration] = None,
69
68
  ) -> Callable[[Type[T]], Type[T]]: ...
70
69
 
71
70
 
@@ -85,7 +84,6 @@ def features(
85
84
  online_store_config: Optional[OnlineStoreConfig] = None,
86
85
  cache_nulls: CacheNullsType = True,
87
86
  cache_defaults: CacheDefaultsType = True,
88
- offline_ttl: Optional[Duration] = None,
89
87
  ) -> Union[Callable[[Type[T]], Type[T]], Type[T]]:
90
88
  """Chalk lets you spell out your features directly in Python.
91
89
 
@@ -143,8 +141,6 @@ def features(
143
141
  The `cache_nulls` and `cache_defaults` options can be used together on the same feature with the
144
142
  following exceptions: if `cache_nulls=False`, then `cache_defaults` cannot be `"evict_defaults"`, and if
145
143
  `cache_nulls="evict_defaults"`, then `cache_defaults` cannot be `False`.
146
- offline_ttl
147
- Sets a maximum age for values eligible to be retrieved from the offline store, defined in relation to the query's current point-in-time.
148
144
  Other Parameters
149
145
  ----------------
150
146
  cls
@@ -190,7 +186,6 @@ def features(
190
186
  node=source_info and source_info.tree,
191
187
  )
192
188
  nonlocal max_staleness
193
- nonlocal offline_ttl
194
189
  if name is not None and re.sub(r"[^a-z_0-9]", "", namespace) != namespace:
195
190
  error_builder.add_diagnostic(
196
191
  message=(
@@ -225,19 +220,6 @@ def features(
225
220
  raise_error=ValueError,
226
221
  code="13",
227
222
  )
228
- if offline_ttl is None:
229
- offline_ttl = CHALK_MAX_TIMEDELTA
230
- else:
231
- try:
232
- offline_ttl = parse_chalk_duration(offline_ttl)
233
- except ValueError as e:
234
- error_builder.add_diagnostic(
235
- message=f"Invalid 'offline_ttl'. {e.args[0]}",
236
- label=f"invalid duration {offline_ttl}",
237
- range=error_builder.decorator_kwarg_value_range(kwarg="offline_ttl"),
238
- raise_error=ValueError,
239
- code="13",
240
- )
241
223
 
242
224
  cache_strategy = get_cache_strategy_from_cache_settings(
243
225
  cache_nulls=cache_nulls,
@@ -289,7 +271,6 @@ def features(
289
271
  tags=ensure_tuple(tags),
290
272
  etl_offline_to_online=etl_offline_to_online,
291
273
  max_staleness=max_staleness,
292
- offline_ttl=offline_ttl,
293
274
  cache_strategy=cache_strategy,
294
275
  namespace=namespace,
295
276
  singleton=singleton,
@@ -438,7 +419,6 @@ def _get_field(
438
419
  class_tags: Optional[Tuple[str, ...]],
439
420
  class_etl_offline_to_online: bool,
440
421
  class_max_staleness: timedelta,
441
- class_offline_ttl: timedelta,
442
422
  namespace: str,
443
423
  is_singleton: bool,
444
424
  class_cache_strategy: CacheStrategy = CacheStrategy.ALL,
@@ -541,7 +521,6 @@ def _get_field(
541
521
  class_tags=class_tags,
542
522
  class_etl_offline_to_online=class_etl_offline_to_online,
543
523
  class_max_staleness=class_max_staleness,
544
- class_offline_ttl=class_offline_ttl,
545
524
  class_cache_strategy=class_cache_strategy,
546
525
  error_builder=error_builder,
547
526
  )
@@ -555,7 +534,6 @@ def _process_field(
555
534
  class_tags: Optional[Tuple[str, ...]],
556
535
  class_etl_offline_to_online: bool,
557
536
  class_max_staleness: timedelta,
558
- class_offline_ttl: timedelta,
559
537
  error_builder: FeatureClassErrorBuilder,
560
538
  class_cache_strategy: CacheStrategy = CacheStrategy.ALL,
561
539
  ) -> Feature:
@@ -618,10 +596,6 @@ def _process_field(
618
596
  if not hasattr(f, "max_staleness"):
619
597
  f.max_staleness = class_max_staleness
620
598
 
621
- # The attribute is not defined if the feature intends to use the class default
622
- if not hasattr(f, "offline_ttl"):
623
- f.offline_ttl = class_offline_ttl
624
-
625
599
  f_cache_nulls, f_cache_defaults = get_cache_settings_from_strategy(f.cache_strategy)
626
600
  class_cache_nulls, class_cache_defaults = get_cache_settings_from_strategy(class_cache_strategy)
627
601
 
@@ -826,7 +800,6 @@ def _process_class(
826
800
  tags: Tuple[str, ...],
827
801
  etl_offline_to_online: bool,
828
802
  max_staleness: timedelta,
829
- offline_ttl: timedelta,
830
803
  namespace: str,
831
804
  singleton: bool,
832
805
  online_store_config: Optional[OnlineStoreConfig],
@@ -1150,7 +1123,6 @@ def _process_class(
1150
1123
  typ=int,
1151
1124
  pyarrow_dtype=pa.uint8(),
1152
1125
  max_staleness=None,
1153
- offline_ttl=None,
1154
1126
  cache_strategy=CacheStrategy.ALL,
1155
1127
  etl_offline_to_online=False,
1156
1128
  is_autogenerated=True,
@@ -1232,7 +1204,6 @@ def _process_class(
1232
1204
  class_tags=tuple(cls.__chalk_tags__),
1233
1205
  class_etl_offline_to_online=cls.__chalk_etl_offline_to_online__,
1234
1206
  class_max_staleness=cls.__chalk_max_staleness__,
1235
- class_offline_ttl=cls.__chalk_offline_ttl__,
1236
1207
  class_cache_strategy=cls.__chalk_cache_strategy__,
1237
1208
  )
1238
1209
 
@@ -1266,7 +1237,6 @@ def _process_class(
1266
1237
  set_new_attribute(cls=cls, name="__chalk_owner__", value=owner)
1267
1238
  set_new_attribute(cls=cls, name="__chalk_tags__", value=list(tags))
1268
1239
  set_new_attribute(cls=cls, name="__chalk_max_staleness__", value=max_staleness)
1269
- set_new_attribute(cls=cls, name="__chalk_offline_ttl__", value=offline_ttl)
1270
1240
  set_new_attribute(cls=cls, name="__chalk_cache_strategy__", value=cache_strategy)
1271
1241
  set_new_attribute(cls=cls, name="__is_features__", value=True)
1272
1242
  set_new_attribute(cls=cls, name="__len__", value=_len_fn)
@@ -1300,7 +1270,6 @@ def _process_class(
1300
1270
  class_tags=tags,
1301
1271
  class_etl_offline_to_online=etl_offline_to_online,
1302
1272
  class_max_staleness=max_staleness,
1303
- class_offline_ttl=offline_ttl,
1304
1273
  class_cache_strategy=cache_strategy,
1305
1274
  namespace=namespace,
1306
1275
  is_singleton=singleton,
@@ -1356,7 +1325,6 @@ def _process_class(
1356
1325
  class_tags=tags,
1357
1326
  class_etl_offline_to_online=etl_offline_to_online,
1358
1327
  class_max_staleness=max_staleness,
1359
- class_offline_ttl=offline_ttl,
1360
1328
  class_cache_strategy=cache_strategy,
1361
1329
  error_builder=error_builder,
1362
1330
  )
@@ -1564,7 +1532,6 @@ def _class_setattr(
1564
1532
  class_tags=tuple(cls.__chalk_tags__),
1565
1533
  class_etl_offline_to_online=cls.__chalk_etl_offline_to_online__,
1566
1534
  class_max_staleness=cls.__chalk_max_staleness__,
1567
- class_offline_ttl=cls.__chalk_offline_ttl__,
1568
1535
  class_cache_strategy=cls.__chalk_cache_strategy__,
1569
1536
  )
1570
1537
  if existing_feature is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chalkpy
3
- Version: 2.93.4
3
+ Version: 2.93.5
4
4
  Summary: Python SDK for Chalk
5
5
  Author: Chalk AI, Inc.
6
6
  Project-URL: Homepage, https://chalk.ai
@@ -1,5 +1,5 @@
1
1
  chalk/__init__.py,sha256=9YxwkAt3Im0OCMfpmnIB_4PKjZfBCcRmwATLXdHNRm4,2609
2
- chalk/_version.py,sha256=utCJDEQ9kRnlcF3Y3HW8XTiSD1NNySR-0CrYIG6jZyo,23
2
+ chalk/_version.py,sha256=XhNKSQO2IT_YMBcv4ezVgd21qof3taOJm_l1W_Po0ms,23
3
3
  chalk/cli.py,sha256=ckqqfOI-A2mT23-rnZzDMmblYj-2x1VBX8ebHlIEn9A,5873
4
4
  chalk/importer.py,sha256=hCEo7eqSfXZWklkFB2geeipGhiD0qNjPBpQJvOBW6N0,63083
5
5
  chalk/prompts.py,sha256=2H9UomLAamdfRTNUdKs9i3VTpiossuyRhntqsAXUhhg,16117
@@ -585,9 +585,9 @@ chalk/features/_last.py,sha256=IyYe0PVAKBu8FRhCZiK6Dy5afKbwDHEUTES5qVXbaZU,1163
585
585
  chalk/features/_tensor.py,sha256=2SQz9cnIywGjHL6LoWj4lrVBa854McFUttJSNV1hKp8,7111
586
586
  chalk/features/_vector.py,sha256=jtJmUTtCaUFru4Fw17PYWozl3pPEdIOCYAuZOqIaN3Y,7205
587
587
  chalk/features/feature_cache_strategy.py,sha256=bXV-tjHfPzUotMpZ3h_D9Xxq-V1CLj_UcVtGIGMpMkI,4942
588
- chalk/features/feature_field.py,sha256=A2QU5lKKo1QSKC6wWH6xLLgKjHzT2c_WJ3ZuA4XyHJM,93637
589
- chalk/features/feature_set.py,sha256=Hhf2PhdaYbdfCdo6DmsXoFKHR-CUcI-FIGLM_pN4HFE,12453
590
- chalk/features/feature_set_decorator.py,sha256=EqW8qDUZzzcSdHCg8sTjqIA1FmxQ3UuzXuliThr7KU4,66580
588
+ chalk/features/feature_field.py,sha256=tLP9iybcYa7eM2eJJ0iSRks-ptyabA0l_SAJ83t6nEw,93758
589
+ chalk/features/feature_set.py,sha256=yNi0_J4CylAVkVp1Y67qV6i8vHMdE0p99DnyLPABPHI,12406
590
+ chalk/features/feature_set_decorator.py,sha256=HMGnQdXQevpsTCNGIG2njViHDnm1ltFoZDhABFkp3Dw,65059
591
591
  chalk/features/feature_time.py,sha256=iUk8NDelig81jP7QT3tguyzx5eOZ-YC84OVgJRRKVwo,1639
592
592
  chalk/features/feature_wrapper.py,sha256=OolNWGGX67IAEMHCObFvOCpH5EmwjbMvMygRSBJJtu0,19259
593
593
  chalk/features/filter.py,sha256=2ldMbqvXC-nJ0jc-OZ36qHtrej-Jkx4TNQ1W_NZodAs,11177
@@ -764,8 +764,8 @@ chalk/utils/tracing.py,sha256=Glx8YrtjWy0zE5YbpgfgcsLDshAKnnYm9poiWNeCxXs,11075
764
764
  chalk/utils/weak_set_by_identity.py,sha256=VmikA_laYwFeOphCwXJIuyOIkrdlQe0bSzaXq7onoQw,953
765
765
  chalk/utils/pydanticutil/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
766
766
  chalk/utils/pydanticutil/pydantic_compat.py,sha256=O575lLYJ5GvZC4HMzR9yATxf9XwjC6NrDUXbNwZidlE,3031
767
- chalkpy-2.93.4.dist-info/METADATA,sha256=YmIFo4vQ1F-AsT9gysGlfwvEo_6yD_5QFHPfM-pUDKI,27494
768
- chalkpy-2.93.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
769
- chalkpy-2.93.4.dist-info/entry_points.txt,sha256=Vg23sd8icwq-morJrljVFr-kQnMbm95rZfZj5wsZGis,42
770
- chalkpy-2.93.4.dist-info/top_level.txt,sha256=1Q6_19IGYfNxSw50W8tYKEJ2t5HKQ3W9Wiw4ia5yg2c,6
771
- chalkpy-2.93.4.dist-info/RECORD,,
767
+ chalkpy-2.93.5.dist-info/METADATA,sha256=YQEhOzUYRmC0EgCz2kpN8vrcq1BYAwYRRDIo1GBxPpg,27494
768
+ chalkpy-2.93.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
769
+ chalkpy-2.93.5.dist-info/entry_points.txt,sha256=Vg23sd8icwq-morJrljVFr-kQnMbm95rZfZj5wsZGis,42
770
+ chalkpy-2.93.5.dist-info/top_level.txt,sha256=1Q6_19IGYfNxSw50W8tYKEJ2t5HKQ3W9Wiw4ia5yg2c,6
771
+ chalkpy-2.93.5.dist-info/RECORD,,