Skip to content

Conversation

@DavidJJ
Copy link

@DavidJJ DavidJJ commented Dec 17, 2025

This change is primarily to fix an issue where if you try to create a trace span using a List instead of a dictionary or BaseModel it errored out even though the upper function signature specified that List[Any] is allowed.

To be able to verify this with built in tests I had to update the requirements * .lock files and then the uv.lock file also got updated.

This all resulted in no longer needing or being required to limit the nox session to pydantic 1.x and it was failing because the code wants pydantic 2 so i removed the pydantic 1.x requirement from the nox file.

This change is primarily to fix an issue where if you try to create a trace span using a List instead of a dictionary or BaseModel it errored out even though the upper function signature specified that List[Any] is allowed.

To be able to verify this with built in tests I had to update the requirements * .lock files and then the uv.lock file also got updated.

This all resulted in no longer needing or being required to limit the nox session to pydantic 1.x and it was failing because the code wants pydantic 2 so i removed the pydantic 1.x requirement from the nox file.
@danielmillerp danielmillerp self-requested a review December 17, 2025 19:12
@danielmillerp
Copy link
Contributor

This change is primarily to fix an issue where if you try to create a trace span using a List instead of a dictionary or BaseModel it errored out even though the upper function signature specified that List[Any] is allowed.

To be able to verify this with built in tests I had to update the requirements * .lock files and then the uv.lock file also got updated.

This all resulted in no longer needing or being required to limit the nox session to pydantic 1.x and it was failing because the code wants pydantic 2 so i removed the pydantic 1.x requirement from the nox file.

potentially a better solution would be to change the top level tracing so it is an honest type check

…not allowing List[Any]

This flips the fix on it's head and instead of allowing List[Any] goes the other way and requires that a list be a List[Dict[str, Any]] which
is what the deeper SPAN object actually wants.

I noticed that the `data` parameter suffers the same lack of type consistency that the `input` parameter had where the SPAN object actually specifies only dicts and lists of dicts are accepted, but upper level functions allow list[Any] so I normalized those as well.
@DavidJJ
Copy link
Author

DavidJJ commented Dec 18, 2025

I reversed the fix so that it goes the other way: requires List[Dict[str, Any]] all the way up the chain.

Also noticed that the same inconsistency exists for the data parameter so I also normalized the types on that as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants