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: Avoid recursive error on nested group references #1016

Merged
merged 4 commits into from
Apr 21, 2024

Conversation

tefra
Copy link
Owner

@tefra tefra commented Apr 16, 2024

📒 Description

The generator supports inner class references, only from outer -> inner, not for inner classes on the same level, or any kind of uneven references, like this.

from dataclasses import dataclass

@dataclass
class A:
    a: "B"

    @dataclass
    class B:
        b: "A.C"

        @dataclass
        class D:
            d: str

    @dataclass
    class C:
        c: "A.B.D"

This is a limiting factor for groups with self references, that causes recursion limit errors. Let's see if we can address that!

Resolves #1008

🔗 What I've Done

Write a description of the steps taken to resolve the issue

💬 Comments

A place to write any comments to the reviewer.

🛫 Checklist

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (762ecb8) to head (00fe560).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1016   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          117       117           
  Lines         9203      9256   +53     
  Branches      2176      2189   +13     
=========================================
+ Hits          9203      9256   +53     

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

@tefra
Copy link
Owner Author

tefra commented Apr 16, 2024

Honestly, one of these days, I am going to remove the support for nested classes.... it's such a pain sometimes.

@tefra tefra changed the title feat: Generate any type of nested class references fix: Avoid recursive error on nested group references Apr 21, 2024
Copy link

sonarcloud bot commented Apr 21, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@tefra tefra marked this pull request as ready for review April 21, 2024 07:42
@tefra tefra merged commit 7628204 into main Apr 21, 2024
15 checks passed
@tefra tefra deleted the improve-nested-class-dependencies branch April 21, 2024 07:43
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.

Recursion Limit Reached
1 participant