Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Community: In case of serialized is NoneType return empty Dict for transform_run of WanDB Tracer #27947

Closed

Conversation

keenborder786
Copy link
Contributor

Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Dec 10, 2024 7:21am

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. community Related to langchain-community 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature labels Nov 6, 2024
@keenborder786
Copy link
Contributor Author

@eyurtsev

@@ -191,14 +191,16 @@ def transform_serialized(serialized: Dict[str, Any]) -> Dict[str, Any]:
serialized = remove_exact_and_partial_keys(serialized)
return serialized

def transform_run(run: Dict[str, Any]) -> Dict[str, Any]:
def transform_run(run: Dict[str, Any]) -> Dict:
Copy link
Collaborator

@eyurtsev eyurtsev Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed?

Suggested change
def transform_run(run: Dict[str, Any]) -> Dict:
def transform_run(run: Dict[str, Any]) -> Dict[str, Any]:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eyurtsev because we are returning an empty dict otherwise the linter raises an error

"""Transforms a run dictionary to be compatible with WBTraceTree.
:param run: The run dictionary to transform.
:return: The transformed run dictionary.
"""
transformed_dict = transform_serialized(run)

serialized = transformed_dict.pop("serialized")
if not serialized:
return {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix isn't correct as far as I can tell -- at least from reading this function code alone (i.e.,
without reading the contents of transform_serialized, there's no way to to determine that this code is written correctly).

Either missing doc-string to explain why empty dict OK or else need to handle case when name / kind are defined but serialized is not available


cc @parambharat

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eyurtsev I was not able to find any other way to make it work

@eyurtsev
Copy link
Collaborator

@parambharat please review or advice on what you want to do w/ respect to users using the community wandb tracer

@keenborder786
Copy link
Contributor Author

@parambharat

1 similar comment
@keenborder786
Copy link
Contributor Author

@parambharat

@ccurme
Copy link
Collaborator

ccurme commented Dec 18, 2024

Closing but will re-open pending review from @parambharat.

@ccurme ccurme closed this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature community Related to langchain-community size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants