-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Fix an exact import bug with deeper nesting #2089
Conversation
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 |
There was a problem hiding this comment.
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
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #2089 will not alter performanceComparing Summary
|
@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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove it?
I don't have any idea how to retry it from your side. OK, I just cleared the cache in GitHub Actions. looks good. |
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 theimport_
to maintain correct heirarchy.