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

[MAINTENANCE] Ruff 0.4.4 #9918

Merged
merged 5 commits into from
May 13, 2024
Merged

[MAINTENANCE] Ruff 0.4.4 #9918

merged 5 commits into from
May 13, 2024

Conversation

Kilo59
Copy link
Member

@Kilo59 Kilo59 commented May 13, 2024

Copy link

netlify bot commented May 13, 2024

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 2dc82ba
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/664221d5a98a7f0008044978

Copy link

netlify bot commented May 13, 2024

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 6f094f5
🔍 Latest deploy log https://app.netlify.com/sites/niobium-lead-7998/deploys/664226533c87020008b86cbb

Copy link

codecov bot commented May 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.24%. Comparing base (4b7aec0) to head (6f094f5).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #9918   +/-   ##
========================================
  Coverage    77.24%   77.24%           
========================================
  Files          491      491           
  Lines        41817    41817           
========================================
  Hits         32300    32300           
  Misses        9517     9517           
Flag Coverage Δ
3.10 63.53% <100.00%> (ø)
3.10 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds ?
3.10 aws_deps ?
3.10 big ?
3.10 databricks ?
3.10 filesystem ?
3.10 mssql ?
3.10 mysql ?
3.10 postgresql ?
3.10 snowflake ?
3.10 spark ?
3.10 trino ?
3.11 63.53% <100.00%> (ø)
3.11 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 53.67% <100.00%> (ø)
3.11 aws_deps 44.73% <100.00%> (ø)
3.11 big 54.24% <100.00%> (ø)
3.11 databricks 45.91% <100.00%> (ø)
3.11 filesystem 59.02% <100.00%> (ø)
3.11 mssql 48.78% <100.00%> (ø)
3.11 mysql 48.83% <100.00%> (ø)
3.11 postgresql 52.70% <100.00%> (ø)
3.11 snowflake 46.55% <100.00%> (-0.01%) ⬇️
3.11 spark 56.29% <100.00%> (ø)
3.11 trino 50.76% <100.00%> (ø)
3.8 63.55% <100.00%> (ø)
3.8 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds 53.67% <100.00%> (ø)
3.8 aws_deps 44.74% <100.00%> (ø)
3.8 big 54.25% <100.00%> (ø)
3.8 databricks 45.93% <100.00%> (ø)
3.8 filesystem 59.03% <100.00%> (ø)
3.8 mssql 48.76% <100.00%> (ø)
3.8 mysql 48.81% <100.00%> (ø)
3.8 postgresql 52.68% <100.00%> (ø)
3.8 snowflake 46.56% <100.00%> (-0.01%) ⬇️
3.8 spark 56.26% <100.00%> (ø)
3.8 trino 50.74% <100.00%> (ø)
3.9 63.54% <100.00%> (ø)
3.9 athena or clickhouse or openpyxl or pyarrow or project or sqlite or aws_creds ?
3.9 aws_deps ?
3.9 big ?
3.9 databricks ?
3.9 filesystem ?
3.9 mssql ?
3.9 mysql ?
3.9 postgresql ?
3.9 snowflake ?
3.9 spark ?
3.9 trino ?
cloud 0.00% <0.00%> (ø)
docs-basic 47.43% <100.00%> (ø)
docs-creds-needed 48.50% <100.00%> (ø)
docs-spark 47.16% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@Kilo59 Kilo59 marked this pull request as ready for review May 13, 2024 14:39
@Kilo59 Kilo59 self-assigned this May 13, 2024
@@ -73,7 +73,7 @@ def __hash__(self: PartitionerMethod):
return hash(self.value)


class DataPartitioner(abc.ABC):
class DataPartitioner(abc.ABC): # noqa: B024
Copy link
Member Author

@Kilo59 Kilo59 May 13, 2024

Choose a reason for hiding this comment

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

I think the violation is understandable given we do need this class to be inherited and never instantied directly.

A Protocal with default methods COULD also work here (or having a distinct Protocol + a DataPartitionerBase), but these don't seem obviously better to me.

I think this is the exception that proves the rule.

https://docs.astral.sh/ruff/rules/abstract-base-class-without-abstract-method/

abstract-base-class-without-abstract-method (B024)

Derived from the flake8-bugbear linter.

What it does

Checks for abstract classes without abstract methods.

Why is this bad?

Abstract base classes are used to define interfaces. If an abstract base
class has no abstract methods, you may have forgotten to add an abstract
method to the class or omitted an @abstractmethod decorator.

If the class is not meant to be used as an interface, consider removing
the ABC base class from the class definition.

Example

from abc import ABC


class Foo(ABC):
    def method(self):
        bar()

Use instead:

from abc import ABC, abstractmethod


class Foo(ABC):
    @abstractmethod
    def method(self):
        bar()

References

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm fine with it as is, even though ABCs without abstractmethods can be instantiated directly. We could also do something like suggested here, but I think it should be apparent to readers that they shouldn't directly instantiate this, which is the most important thin IMO

@Kilo59 Kilo59 added this pull request to the merge queue May 13, 2024
Merged via the queue into develop with commit 9c9d551 May 13, 2024
69 checks passed
@Kilo59 Kilo59 deleted the linter-update branch May 13, 2024 16:14
joshua-stauffer pushed a commit that referenced this pull request May 14, 2024
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.

None yet

2 participants