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

Reintroduce Python Compatibility Changes #2785

Merged
merged 3 commits into from
Jun 2, 2023

Conversation

DavidBakerEffendi
Copy link
Collaborator

  • Reverted commit 4691b4a
  • Added tests that were resulting in some failure
  • Added support for string constant type hints (idk how but this is valid Python)
  • Using ForkJoinParallelCpgPass for DynamicTypeHintFullNamePass
  • Making sure that DynamicTypeHintFullNamePass considers types within the current scope

@DavidBakerEffendi DavidBakerEffendi marked this pull request as ready for review May 31, 2023 13:34
@DavidBakerEffendi DavidBakerEffendi added python Relates to pysrc2cpg performance Improves the performance of Joern compatibility Concerns fixing either upstream or downstream compatibility labels May 31, 2023
@ml86
Copy link
Contributor

ml86 commented Jun 1, 2023

Is this the minimally adjusted version of commit 4691b4a to make the type propagation happy? Do we need the switch to ForkJoinParallelCpgPass in this PR? I am asking because i would like to diff this PR and my initial version of it.

@DavidBakerEffendi
Copy link
Collaborator Author

@ml86 Wouldn't say "minimally" but it does fix some assumptions on the type propagation to make it "happier". The ForkJoinParallelCpgPass is not necessary, but the other changes on DynamicTypeHintFullNamePass are necessary.

* Added tests that were resulting in some failure
* Added support for string constant type hints (idk how but this is valid Python)
* Using `ForkJoinParallelCpgPass` for `DynamicTypeHintFullNamePass`
* Making sure that `DynamicTypeHintFullNamePass` considers types within the current scope
* Sharing the logic for import path resolution between `XInheritanceFullNamePass` and `DynamicTypeHintFullNamePass`
Copy link
Contributor

@ml86 ml86 left a comment

Choose a reason for hiding this comment

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

Look good. Tests pass.

@DavidBakerEffendi DavidBakerEffendi merged commit af9761d into master Jun 2, 2023
5 checks passed
@DavidBakerEffendi DavidBakerEffendi deleted the dave/py-revert-back-pychanges branch June 2, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Concerns fixing either upstream or downstream compatibility performance Improves the performance of Joern python Relates to pysrc2cpg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants