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

Type-Checking the Zip operator on Dictionary should not crash #149

Merged
merged 5 commits into from
Sep 12, 2024

Conversation

gordonwatts
Copy link
Member

@gordonwatts gordonwatts commented Sep 12, 2024

  • When Zip or zip is used on a dictionary, the type follower punts and returns only Any
  • This will prevent the crash seen in this bug report.
  • The correct types can be followed through here. See Correctly make Zip type following work #150 for more information.

Closes #148

Add a new test case to check that the type follows from a dictionary through a Zip operation. The test creates a lambda expression that selects the 'pt' attribute from a dictionary of jets, which are obtained from an event object. The test ensures that the expected exception is raised when an invalid key is used.

Refactor the test_type_based_replacement.py file to include the new test_dictionary_Zip_key() function.
@gordonwatts gordonwatts self-assigned this Sep 12, 2024
@gordonwatts gordonwatts added the bug Something isn't working label Sep 12, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.93%. Comparing base (95b14c9) to head (77e4888).

Files with missing lines Patch % Lines
func_adl/ast/function_simplifier.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #149   +/-   ##
=======================================
  Coverage   96.93%   96.93%           
=======================================
  Files          15       15           
  Lines        1336     1338    +2     
=======================================
+ Hits         1295     1297    +2     
  Misses         41       41           
Flag Coverage Δ
unittests 96.93% <75.00%> (+<0.01%) ⬆️

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.

@gordonwatts gordonwatts changed the title Properly type-check Zip operator on Dictionary Type-Checking the Zip operator on Dictionary should not crash Sep 12, 2024
@gordonwatts gordonwatts merged commit 29a3406 into master Sep 12, 2024
32 checks passed
@gordonwatts gordonwatts deleted the bug/zip branch September 12, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zip lookup for function types is causing a type tracing failure
2 participants