arize-phoenix 7.8.0__py3-none-any.whl → 7.8.1__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 arize-phoenix might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arize-phoenix
3
- Version: 7.8.0
3
+ Version: 7.8.1
4
4
  Summary: AI Observability and Evaluation
5
5
  Project-URL: Documentation, https://docs.arize.com/phoenix/
6
6
  Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
@@ -6,7 +6,7 @@ phoenix/exceptions.py,sha256=n2L2KKuecrdflB9MsCdAYCiSEvGJptIsfRkXMoJle7A,169
6
6
  phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
7
7
  phoenix/services.py,sha256=kpW1WL0kiB8XJsO6XycvZVJ-lBkNoenhQ7atCvBoSe8,5365
8
8
  phoenix/settings.py,sha256=ht-0oN-sMV6SPXrk7Tu1EZlngpAYkGNLYPhO8DyrdQI,661
9
- phoenix/version.py,sha256=vZw91QDi0kVrQT2yAQVzBUsHnFXKxQOJTwxJLeLNYNo,22
9
+ phoenix/version.py,sha256=q9HCYvd_KKYPNhrFJZNCqDLkLzTKEm20j2_jzE7u-Lw,22
10
10
  phoenix/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  phoenix/core/embedding_dimension.py,sha256=zKGbcvwOXgLf-yrJBpQyKtd-LEOPRKHnUToyAU8Owis,87
12
12
  phoenix/core/model.py,sha256=qBFraOtmwCCnWJltKNP18DDG0mULXigytlFsa6YOz6k,4837
@@ -102,7 +102,7 @@ phoenix/server/api/utils.py,sha256=quCBRcusc6PUq9tJq7M8PgwFZp7nXgVAxtbw8feribY,8
102
102
  phoenix/server/api/dataloaders/__init__.py,sha256=nt5Lbs34q05GSvNCT2IGrkRW0kg65L8h3bZelzgpkYg,3909
103
103
  phoenix/server/api/dataloaders/annotation_summaries.py,sha256=2sHmIDX7n8tuPeBTs9bMKtlMKWn_Ph9awTZqmwn2Owc,5505
104
104
  phoenix/server/api/dataloaders/average_experiment_run_latency.py,sha256=GLFoFAbztOH-0FVzzZ77mATIO63UcjB50j3qXiNi-tE,1811
105
- phoenix/server/api/dataloaders/dataset_example_revisions.py,sha256=YG2VSWOkM7q_-RO8OwE8bHYX8d3_OH34SeaD4pvEt0w,5115
105
+ phoenix/server/api/dataloaders/dataset_example_revisions.py,sha256=xF7M2dg3UmjhdCrscnztCIBBI0cg3RF48IIqvilpc18,4623
106
106
  phoenix/server/api/dataloaders/dataset_example_spans.py,sha256=z_MFquqAcJ9wat7BBp7MVeJ9BYuu2EZEdaog52iWDno,1390
107
107
  phoenix/server/api/dataloaders/document_evaluation_summaries.py,sha256=9fdROnzp-mymggHwNvpRkCk93LUFxxLy55-j3HP_2HY,5565
108
108
  phoenix/server/api/dataloaders/document_evaluations.py,sha256=KCnCItJ2DQOCHvxFp1KK2AStPN1akGlAGOEzEAu6c6I,1246
@@ -337,9 +337,9 @@ phoenix/utilities/project.py,sha256=auVpARXkDb-JgeX5f2aStyFIkeKvGwN9l7qrFeJMVxI,
337
337
  phoenix/utilities/re.py,sha256=x8Xbk-Wa6qDMAtUd_7JtZvKtrYEuMY-bchB0n163_5c,2006
338
338
  phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
339
339
  phoenix/utilities/template_formatters.py,sha256=gh9PJD6WEGw7TEYXfSst1UR4pWWwmjxMLrDVQ_CkpkQ,2779
340
- arize_phoenix-7.8.0.dist-info/METADATA,sha256=EM8prb9RNrEFDt2ZmeTjMnwammFcOhmf-LMhDooHnYU,23052
341
- arize_phoenix-7.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
342
- arize_phoenix-7.8.0.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
343
- arize_phoenix-7.8.0.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
344
- arize_phoenix-7.8.0.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
345
- arize_phoenix-7.8.0.dist-info/RECORD,,
340
+ arize_phoenix-7.8.1.dist-info/METADATA,sha256=saLGcoxnbaN2fat0opLf_ayMiIPtYHf7LgmOW-4RBjk,23052
341
+ arize_phoenix-7.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
342
+ arize_phoenix-7.8.1.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
343
+ arize_phoenix-7.8.1.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
344
+ arize_phoenix-7.8.1.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
345
+ arize_phoenix-7.8.1.dist-info/RECORD,,
@@ -1,6 +1,6 @@
1
1
  from typing import Optional, Union
2
2
 
3
- from sqlalchemy import and_, case, func, null, or_, select
3
+ from sqlalchemy import Integer, case, func, or_, select, union
4
4
  from sqlalchemy.sql.expression import literal
5
5
  from strawberry.dataloader import DataLoader
6
6
  from typing_extensions import TypeAlias
@@ -20,74 +20,50 @@ class DatasetExampleRevisionsDataLoader(DataLoader[Key, Result]):
20
20
  def __init__(self, db: DbSessionFactory) -> None:
21
21
  super().__init__(
22
22
  load_fn=self._load_fn,
23
- max_batch_size=200, # needed to prevent the size of the query from getting too large
23
+ # Setting max_batch_size to prevent the size of the query from getting too large.
24
+ # The maximum number of terms is SQLITE_MAX_COMPOUND_SELECT which defaults to 500.
25
+ # This is needed because of the compound select query below used in transferring
26
+ # the input data to the database. SQLite in fact has better ways to transfer data,
27
+ # but unfortunately they're not made available in sqlalchemy yet.
28
+ max_batch_size=200,
24
29
  )
25
30
  self._db = db
26
31
 
27
32
  async def _load_fn(self, keys: list[Key]) -> list[Union[Result, NotFound]]:
28
- example_and_version_ids = tuple(
29
- set(
30
- (example_id, version_id)
31
- for example_id, version_id in keys
32
- if version_id is not None
33
- )
34
- )
35
- versionless_example_ids = tuple(
36
- set(example_id for example_id, version_id in keys if version_id is None)
37
- )
38
- resolved_example_and_version_ids = (
39
- (
33
+ # sqlalchemy has limited SQLite support for VALUES, so use UNION ALL instead.
34
+ # For details, see https://github.com/sqlalchemy/sqlalchemy/issues/7228
35
+ keys_subquery = union(
36
+ *(
40
37
  select(
41
- models.DatasetExample.id.label("example_id"),
42
- models.DatasetVersion.id.label("version_id"),
43
- )
44
- .select_from(models.DatasetExample)
45
- .join(
46
- models.DatasetVersion,
47
- onclause=literal(True), # cross join
48
- )
49
- .where(
50
- or_(
51
- *(
52
- and_(
53
- models.DatasetExample.id == example_id,
54
- models.DatasetVersion.id == version_id,
55
- )
56
- for example_id, version_id in example_and_version_ids
57
- )
58
- )
38
+ literal(example_id, Integer).label("example_id"),
39
+ literal(version_id, Integer).label("version_id"),
59
40
  )
41
+ for example_id, version_id in keys
60
42
  )
61
- .union(
62
- select(
63
- models.DatasetExample.id.label("example_id"), null().label("version_id")
64
- ).where(models.DatasetExample.id.in_(versionless_example_ids))
65
- )
66
- .subquery()
67
- )
43
+ ).subquery()
68
44
  revision_ids = (
69
45
  select(
70
- resolved_example_and_version_ids.c.example_id,
71
- resolved_example_and_version_ids.c.version_id,
46
+ keys_subquery.c.example_id,
47
+ keys_subquery.c.version_id,
72
48
  func.max(models.DatasetExampleRevision.id).label("revision_id"),
73
49
  )
74
- .select_from(resolved_example_and_version_ids)
50
+ .select_from(keys_subquery)
75
51
  .join(
76
52
  models.DatasetExampleRevision,
77
- onclause=resolved_example_and_version_ids.c.example_id
53
+ onclause=keys_subquery.c.example_id
78
54
  == models.DatasetExampleRevision.dataset_example_id,
79
55
  )
80
56
  .where(
81
57
  or_(
82
- resolved_example_and_version_ids.c.version_id.is_(None),
83
- models.DatasetExampleRevision.dataset_version_id
84
- <= resolved_example_and_version_ids.c.version_id,
58
+ # This query gets the latest `revision_id` for each example:
59
+ # - If `version_id` is NOT given, it finds the maximum `revision_id`.
60
+ # - If `version_id` is given, it finds the highest `revision_id` whose
61
+ # `version_id` is less than or equal to the one specified.
62
+ keys_subquery.c.version_id.is_(None),
63
+ models.DatasetExampleRevision.dataset_version_id <= keys_subquery.c.version_id,
85
64
  )
86
65
  )
87
- .group_by(
88
- resolved_example_and_version_ids.c.example_id,
89
- resolved_example_and_version_ids.c.version_id,
90
- )
66
+ .group_by(keys_subquery.c.example_id, keys_subquery.c.version_id)
91
67
  ).subquery()
92
68
  query = (
93
69
  select(
phoenix/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "7.8.0"
1
+ __version__ = "7.8.1"