Arize-ai / phoenix

AI Observability & Evaluation
https://docs.arize.com/phoenix
Other
3.95k stars 292 forks source link

[auth] ☂️ migrate to pydantic #3855

Closed axiomofjoy closed 3 months ago

axiomofjoy commented 4 months ago
axiomofjoy commented 4 months ago

Logged span and document evaluations are not appearing in the trace table.

mikeldking commented 3 months ago

dataset_description is still a parame to append_to_dataset

unrelated

RogerHYang commented 3 months ago

import error for pydantic==1.7.4

to reproduce

%pip install -Uqqq "pydantic==1.7.4" "arize-phoenix==4.12.1rc1"

import phoenix as px
TypeError: Fields of type "<class 'typing.Annotated'>" are not supported.
Screenshot 2024-07-22 at 12 40 29 PM
fjcasti1 commented 3 months ago

When running client.get_dataset_versions('RGF0YXNldDox') we get following error. It did not happen with one version, only when I added one.

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-37-1f23e5e0ca49>](https://localhost:8080/#) in <cell line: 1>()
----> 1 client.get_dataset_versions('RGF0YXNldDox')

5 frames
[/usr/local/lib/python3.10/dist-packages/phoenix/session/client.py](https://localhost:8080/#) in get_dataset_versions(self, dataset_id, limit)
    411             return pd.DataFrame()
    412         df = pd.DataFrame.from_records(records, index="version_id")
--> 413         df["created_at"] = pd.to_datetime(df.created_at)
    414         return df
    415 

[/usr/local/lib/python3.10/dist-packages/pandas/core/tools/datetimes.py](https://localhost:8080/#) in to_datetime(arg, errors, dayfirst, yearfirst, utc, format, exact, unit, infer_datetime_format, origin, cache)
   1048             result = arg.map(cache_array)
   1049         else:
-> 1050             values = convert_listlike(arg._values, format)
   1051             result = arg._constructor(values, index=arg.index, name=arg.name)
   1052     elif isinstance(arg, (ABCDataFrame, abc.MutableMapping)):

[/usr/local/lib/python3.10/dist-packages/pandas/core/tools/datetimes.py](https://localhost:8080/#) in _convert_listlike_datetimes(arg, format, name, utc, unit, errors, dayfirst, yearfirst, exact)
    451     # `format` could be inferred, or user didn't ask for mixed-format parsing.
    452     if format is not None and format != "mixed":
--> 453         return _array_strptime_with_fallback(arg, name, utc, format, exact, errors)
    454 
    455     result, tz_parsed = objects_to_datetime64ns(

[/usr/local/lib/python3.10/dist-packages/pandas/core/tools/datetimes.py](https://localhost:8080/#) in _array_strptime_with_fallback(arg, name, utc, fmt, exact, errors)
    482     Call array_strptime, with fallback behavior depending on 'errors'.
    483     """
--> 484     result, timezones = array_strptime(arg, fmt, exact=exact, errors=errors, utc=utc)
    485     if any(tz is not None for tz in timezones):
    486         return _return_parsed_timezone_results(result, timezones, utc, name)

/usr/local/lib/python3.10/dist-packages/pandas/_libs/tslibs/strptime.pyx in pandas._libs.tslibs.strptime.array_strptime()

/usr/local/lib/python3.10/dist-packages/pandas/_libs/tslibs/strptime.pyx in pandas._libs.tslibs.strptime.array_strptime()

ValueError: time data "2024-07-22T19:29:55+00:00" doesn't match format "%Y-%m-%dT%H:%M:%S.%f%z", at position 1. You might want to try:
    - passing `format` if your strings have a consistent format;
    - passing `format='ISO8601'` if your strings are all ISO8601 but not necessarily in exactly the same format;
    - passing `format='mixed'`, and the format will be inferred for each element individually. You might want to use `dayfirst` alongside this.
!pip show pydantic
Name: pydantic
Version: 1.10.17
Summary: Data validation and settings management using python type hints
Home-page: https://github.com/pydantic/pydantic
Author: Samuel Colvin
Author-email: [s@muelcolvin.com](mailto:s@muelcolvin.com)
License: MIT
Location: /usr/local/lib/python3.10/dist-packages
Requires: typing-extensions
Required-by: confection, google-cloud-aiplatform, google-generativeai, inflect, spacy, thinc, weasel
!python --version
Python 3.10.12
mikeldking commented 3 months ago

get_dataset_versions requires positional args and doesn't accept kwargs

axiomofjoy commented 3 months ago

https://github.com/Arize-ai/phoenix/issues/3855#issuecomment-2243665752

Turns out fastapi is not actually compatible with its stated lower bound.

Right now, we just pin our own lower bound at pydantic>=1.0 and rely on fastapi to handle its own dependency ranges. It looks like the current version of fastapi actually requires pydantic>=1.10, but not sure if we add this lower bound to our pyproject.toml in case someone wants to install an old version of fastapi that has support for lower versions of pydantic. Punting until someone complains.