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

Remove redundant if-condition in the GraphWalker._iter_one #3654

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JCZuurmond
Copy link
Member

@JCZuurmond JCZuurmond commented Feb 6, 2025

Changes

Remove redundant if-condition in the GraphWalker._iter_one

Linked issues

Progresses #3626

Functionality

  • Code linting

@JCZuurmond JCZuurmond added migrate/code Abstract Syntax Trees and other dark magic migrate/python Pull requests that update Python code python Pull requests that update Python code internal this pull request won't appear in release notes labels Feb 6, 2025
@JCZuurmond JCZuurmond self-assigned this Feb 6, 2025
@JCZuurmond JCZuurmond requested a review from a team as a code owner February 6, 2025 15:09
@@ -56,16 +56,15 @@ def _iter_one(self, dependency: Dependency, graph: DependencyGraph, root_path: P
self._lineage.append(dependency)
self._walked_paths.add(dependency.path)
self._log_walk_one(dependency)
if dependency.path.is_file() or is_a_notebook(dependency.path):
Copy link
Member Author

Choose a reason for hiding this comment

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

@pritishpai and @asnare : This is another if-condition in this method about which I am unsure. However, I want to remove it as it is interfering with surfacing known problems during linting.

Notes:

  • Removing the if-condition does not let any unit test fail
  • The condition was introduced without notes, explanation or questions
  • IMO the base graph walker class should not decide to skip a dependency. Classes that inherit form this class can decide to skip specific dependencies
  • I introduced a new dependency to surface known problems, KnownDependency, which is not processed as the condition is not true for that dependency. Instead of extending the condition, I think it should be removed all together

Copy link

github-actions bot commented Feb 6, 2025

✅ 57/57 passed, 2 skipped, 1h14m58s total

Running from acceptance #8219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal this pull request won't appear in release notes migrate/code Abstract Syntax Trees and other dark magic migrate/python Pull requests that update Python code python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant