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 an exact import bug with deeper nesting #2089

Conversation

AniketDas-Tekky
Copy link
Contributor

If a schema hierarchy was deeper than 1 level and a schema referenced another schema at a higher level, then the exact import function would add an extra '.'.
This change checks if from_ is any number of '.' and prepends it to the import_ to maintain correct heirarchy.

If a schema heirarchy was deeper than 1 level and a schema referenced
another schema at a higher level, then the exact import function would
add an extra '.'.
This change checks if `from_` is any number of '.' and prepends it
to the `import_` to maintain correct heirarchy.
@@ -22,7 +22,7 @@ $ cd datamodel-code-generator
$ curl -sSL https://install.python-poetry.org | python3 -

## 3. Install dependencies
$ poetry install
$ poetry install --all-extras
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tests.sh fails without graphql installed

Copy link

codecov bot commented Sep 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (295b758) to head (5166b1e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2089   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        38           
  Lines         4205      4205           
  Branches       976       976           
=========================================
  Hits          4205      4205           
Flag Coverage Δ
unittests 99.66% <100.00%> (ø)

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.

Copy link

codspeed-hq bot commented Sep 17, 2024

CodSpeed Performance Report

Merging #2089 will not alter performance

Comparing AniketDas-Tekky:adas/exact-import/fix-deeper-nesting-dots (5166b1e) with main (295b758)

Summary

✅ 31 untouched benchmarks

@AniketDas-Tekky
Copy link
Contributor Author

@koxudaxi Is there a way to rerun the action? The action failed with "Pytest missing" which seems strange.

@prmshepherd
Copy link
Contributor

@koxudaxi Is there a way to rerun the action? The action failed with "Pytest missing" which seems strange.

I had the same problem in my PR too

@@ -238,11 +238,15 @@ def relative(current_module: str, reference: str) -> Tuple[str, str]:
return left, right


# def absolute()
Copy link
Owner

Choose a reason for hiding this comment

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

Can you remove it?

@koxudaxi
Copy link
Owner

@koxudaxi Is there a way to rerun the action? The action failed with "Pytest missing" which seems strange.

I don't have any idea how to retry it from your side.

OK, I just cleared the cache in GitHub Actions. looks good.

@koxudaxi koxudaxi merged commit 8291eed into koxudaxi:main Sep 27, 2024
76 checks passed
@AniketDas-Tekky AniketDas-Tekky deleted the adas/exact-import/fix-deeper-nesting-dots branch September 27, 2024 22:09
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