-
Notifications
You must be signed in to change notification settings - Fork 87
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
Move Revision
enum from schemas/common.py
#1367
Comments
Revision
from schemas/common.py
Revision
enum from schemas/common.py
Hello @franciszekjob can i work on this? |
Hey @ScottyDavies, you're welcome to open a PR for it. |
out of curiosity do contributors get paid? @franciszekjob |
@ScottyDavies At this moment, we do not sponsor this issue nor any other issues through OnlyDust. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedI have experience in all the languages used in the issue, so it would be easier for me to achieve it. How I plan on tackling this issueTo resolve the circular import issue when moving Revision to models/typed_data.py, you can refactor the imports by placing any problematic imports within functions or methods to delay them, thus breaking the circular dependency. Alternatively, you could move the Revision class into its own module (e.g., models/revision.py), allowing both schemas/common.py and models/typed_data.py to import it without issues. This isolates the Revision class, avoiding direct dependencies between the two modules. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedFull-Stack Engineer: Leverage: Use my knowledge of module systems in Python and TypeScript to identify where the circular dependencies are occurring and determine the best way to isolate the Revision enum without breaking functionality. Experience in Object-Oriented Programming: Leverage: Apply object-oriented design principles to reorganize the project into a more modular structure. By separating shared components into dedicated modules, you can avoid circular imports and improve code maintainability. Problem Solving and Refactoring Expertise: Leverage: Apply problem-solving techniques to identify whether breaking the circular dependency through restructuring or using local imports is the most effective solution. My ability to debug complex issues will help streamline this process. Conclusion: How I plan on tackling this issueTo address the issue of moving the Revision enum from schemas/common.py while solving the circular import errors, here’s how I would approach the problem: Firstly, It's to Understand the Cause of Circular Import: Moving Revision to a Separate Module schemas/revision_enum.pyfrom enum import Enum class Revision(Enum): models/typed_data.pyfrom schemas.revision_enum import Revision |
@DioChuks please open a PR if you want to contribute, thanks. |
I am applying to this issue via OnlyDust platform. My background and how it can be leveragedWith a background in software development, particularly in Python and modular application design, I have experience managing complex project structures and resolving issues like circular dependencies. I also have a good understanding of database schemas, ORM (Object-Relational Mapping), and Python packaging, which can be useful in solving this problem. How I plan on tackling this issueIdentify Circular Dependencies: First, I would trace the exact point of circular dependency between schemas/common.py and models/typed_data.py. This will help identify the imports that are causing the issue. If the Revision class or function is being used in both files, it is crucial to understand where and how it is being referenced. Option 1: Create a Separate Module: One of the most effective solutions for resolving circular dependencies is moving the Revision class or function to a new, dedicated module (e.g., common/revision.py). This will allow both schemas/common.py and models/typed_data.py to import Revision without directly depending on each other. Option 2: Lazy Import or Intra-function Import: If refactoring is not feasible, I would use lazy imports (importing inside functions instead of globally) to break the circular reference while keeping the existing structure intact. Test the Changes: After implementing the solution, I would run the project’s unit and integration tests to ensure that the refactoring resolves the circular import issue without introducing new bugs. I would document the changes clearly, especially if the Revision class is moved to a separate module. This ensures that other developers working on the project understand the new structure. |
The maintainer franciszekjob has assigned manicdon7 to this issue via OnlyDust Platform. |
Feature Request
Currently
Revision
is stored inschemas/common.py
. There are circular import errors when storing it inmodels/typed_data.py
.Revision
should be moved to either separate file ormodels/typed_data.py
after solving circular import errors.The text was updated successfully, but these errors were encountered: