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

style: scripts/v.report/v.report.py:fixed F841 local variable 'numcols' is assigned to but never used #1609

Closed
wants to merge 5 commits into from

Conversation

ShubhamSwati
Copy link
Contributor

…ssigned to but never used

@@ -63,7 +63,7 @@ def print_map_band_reference(name, band_reader):
band_reader.print_info(shortcut, band)
else:
gs.info(_("No band reference assigned to <{}>").format(name))
except OpenError as e:
except OpenError as e: # noqa: F841
Copy link
Member

Choose a reason for hiding this comment

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

No need to keep these XyzException as error pieces if the error is not used (except XyzException is perfectly valid), but here, can you check the source code for what OpenError contains, i.e., if it has any more specific message which would add details to (or replace).

@landam can comment here in case he had some intentions with the captured error originally.

Copy link
Member

Choose a reason for hiding this comment

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

Already addressed in #4241, but since this PR, this module was renamed to r.semantic.label.

@@ -95,7 +95,7 @@ def manage_map_band_reference(name, band_ref):
except GrassError as e:
gs.error(_("Unable to assign/dissociate band reference. {}").format(e))
return 1
except OpenError as e:
except OpenError as e: # noqa: F841
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

Copy link
Member

Choose a reason for hiding this comment

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

Already addressed in #4241

table = options["table"]
table = options["table"] # noqa: F841
Copy link
Member

Choose a reason for hiding this comment

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

The fact that it is unused looks like a bug. Can you please check the rest of the code to see if it is potentially missing anywhere (like parameter for another module or something like layer is used instead of it in an SQL expression? Alternatively, you can just leave this out for this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I looked at it and this looks like option table was never used, so I think we should remove it in a separate PR. It would sort of break backwards compatibility, but if the option was never used, I assume it would be fine.

scripts/v.report/v.report.py Outdated Show resolved Hide resolved
scripts/.flake8 Outdated Show resolved Hide resolved
@wenzeslaus
Copy link
Member

Thanks @ShubhamSwati! The smaller PRs are much easier to review and perhaps we can get some PRs merged sooner while still working on others.

@neteler neteler added bug Something isn't working Python Related code is in Python labels Dec 9, 2021
@neteler neteler added this to the 8.0.1 milestone Dec 9, 2021
@ninsbl ninsbl modified the milestones: 8.0.1, 8.0.2 Feb 20, 2022
@ninsbl
Copy link
Member

ninsbl commented Feb 20, 2022

Bumping up milestone as 8.0.1 is due in two days, while this has not been part of RC1 and there has not been activity for some time.

@wenzeslaus wenzeslaus modified the milestones: 8.0.2, 8.2.0 Feb 24, 2022
@wenzeslaus
Copy link
Member

This is not directly fixing any bug, although it is fixing and improving the code, so no need to keep it in 8.0 series. @ninsbl feel free to move milestone for PRs/issues like this without any comment. You can also simply decide based on the absence of blocker label. No blocker label? Move to next minor.

@wenzeslaus wenzeslaus modified the milestones: 8.2.0, 8.4.0 Feb 27, 2022
@wenzeslaus wenzeslaus modified the milestones: 8.3.0, 8.4.0 Feb 14, 2023
scripts/.flake8 Outdated Show resolved Hide resolved
@@ -67,7 +67,7 @@ def main():
layer = options["layer"]
format = options["format"]
output = options["output"]
table = options["table"]
table = options["table"] # noqa: F841
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
table = options["table"] # noqa: F841
table = options["table"]

@wenzeslaus wenzeslaus modified the milestones: 8.4.0, Future Apr 27, 2024
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

Some parts are already addressed, so only the part of db.out.ogr remain in this PR

scripts/v.report/v.report.py Outdated Show resolved Hide resolved
@@ -63,7 +63,7 @@ def print_map_band_reference(name, band_reader):
band_reader.print_info(shortcut, band)
else:
gs.info(_("No band reference assigned to <{}>").format(name))
except OpenError as e:
except OpenError as e: # noqa: F841
Copy link
Member

Choose a reason for hiding this comment

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

Already addressed in #4241, but since this PR, this module was renamed to r.semantic.label.

@@ -95,7 +95,7 @@ def manage_map_band_reference(name, band_ref):
except GrassError as e:
gs.error(_("Unable to assign/dissociate band reference. {}").format(e))
return 1
except OpenError as e:
except OpenError as e: # noqa: F841
Copy link
Member

Choose a reason for hiding this comment

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

Already addressed in #4241

@github-actions github-actions bot added database Related to database management module labels Sep 26, 2024
@echoix
Copy link
Member

echoix commented Sep 26, 2024

I managed to solve the conflicts of the renamed files and updated 3 years of commits to the PR. Some issues have been fixed since

@echoix echoix changed the title scripts/v.report/v.report.py:fixed F841 local variable 'numcols' is a… style: scripts/v.report/v.report.py:fixed F841 local variable 'numcols' is assigned to but never used Sep 26, 2024
@echoix
Copy link
Member

echoix commented Sep 26, 2024

@arohanajit Do you want to take a look and try to review this? With all the experience you've had until now, you could also try the reverse role ;) It's an old PR, that when solving conflicts, there's not much left. You might want to take a look that the correct exclusions are used, as the flake8 config file used before my merge today was in another folder, and doesn't exist anymore.

@arohanajit
Copy link
Contributor

@arohanajit Do you want to take a look and try to review this? With all the experience you've had until now, you could also try the reverse role ;) It's an old PR, that when solving conflicts, there's not much left. You might want to take a look that the correct exclusions are used, as the flake8 config file used before my merge today was in another folder, and doesn't exist anymore.

This one isn't fixed either. And I don't think this PR is actually doing anything. This error is also listed in the current .flake8 so I'll be fixing this as I go through the file

@echoix echoix closed this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working database Related to database management module Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants