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

fix ImportFromModule is unhashable issue #3362

Merged

Conversation

zcipod
Copy link
Contributor

@zcipod zcipod commented Aug 16, 2024

This fix makes the conversion to string prior to the deduplication to avoid this issue

Why are these changes needed?

When create user defined functions, an exception occurs because of the deduplication of ImportFromModule
This fix makes the conversion to string prior to the deduplication to avoid this issue

Related issue number

Closes #3361

Checks

This fix makes the conversion to string prior to the deduplication to avoid this issue
Copy link
Collaborator

@thinkall thinkall left a comment

Choose a reason for hiding this comment

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

Thank you @zcipod for the PR! LGTM.

Copy link
Collaborator

@thinkall thinkall left a comment

Choose a reason for hiding this comment

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

Could you please fix the type check error? Thanks.

@codecov-commenter
Copy link

codecov-commenter commented Aug 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 25.89%. Comparing base (6279247) to head (f68c644).
Report is 99 commits behind head on main.

Files Patch % Lines
autogen/coding/func_with_reqs.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3362      +/-   ##
==========================================
- Coverage   32.90%   25.89%   -7.02%     
==========================================
  Files          94      101       +7     
  Lines       10235    10752     +517     
  Branches     2193     2456     +263     
==========================================
- Hits         3368     2784     -584     
- Misses       6580     7673    +1093     
- Partials      287      295       +8     
Flag Coverage Δ
unittest 12.10% <0.00%> (?)
unittests 25.13% <0.00%> (-7.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zcipod
Copy link
Contributor Author

zcipod commented Aug 21, 2024

Could you please fix the type check error? Thanks.

Sorry for late response.
Type annotation for global_imports has been added
thanks @thinkall

Copy link
Collaborator

@thinkall thinkall left a comment

Choose a reason for hiding this comment

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

Hi @zcipod , could you please run pre-commit to fix the code format issue? Thanks. https://microsoft.github.io/autogen/docs/contributor-guide/pre-commit

auto-merge was automatically disabled August 23, 2024 06:57

Head branch was pushed to by a user without write access

@zcipod
Copy link
Contributor Author

zcipod commented Aug 26, 2024

Hi @jackgerrits @qingyun-wu,

Could you please have a review of this PR? Thanks!

@thinkall thinkall added this pull request to the merge queue Aug 26, 2024
Merged via the queue into microsoft:main with commit 3aa0528 Aug 26, 2024
131 of 143 checks passed
victordibia pushed a commit that referenced this pull request Aug 28, 2024
* ImportFromModule is unhashable
This fix makes the conversion to string prior to the deduplication to avoid this issue

* add type annotation for global_imports

* meet code formatting check

---------

Co-authored-by: zcipod <[email protected]>
Co-authored-by: Li Jiang <[email protected]>
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.

[Bug]: TypeError: unhashable type: 'ImportFromModule' for User Defined Functions
4 participants