-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref: Add ruff rules for naming (N) #4187
Conversation
@@ -50,8 +50,8 @@ def build( | |||
api_key: str, | |||
url: str, | |||
timeout: int = 30000, | |||
crawlerOptions: Data | None = None, | |||
pageOptions: Data | None = None, | |||
crawlerOptions: Data | None = None, # noqa: N803 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it would be breaking to change the field config name ?
@@ -65,13 +65,13 @@ def validate_flow_id(cls, value): | |||
return value | |||
|
|||
@field_serializer("flow_id") | |||
def serialize_flow_id(value): | |||
def serialize_flow_id(self, value): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or could be a staticmethod
. Using an instance method for consistency with pydantic docs.
@@ -111,7 +113,8 @@ def validate_icon_atr(cls, v): | |||
return v | |||
|
|||
@field_validator("data") | |||
def validate_json(v): | |||
@classmethod | |||
def validate_json(cls, v): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or could be a staticmethod
. Using a class method for consistency with pydantic's docs.
@@ -82,7 +82,7 @@ async def log_package_run(self, payload: RunPayload): | |||
await self._queue_event((self.send_telemetry_data, payload, "run")) | |||
|
|||
async def log_package_shutdown(self): | |||
payload = ShutdownPayload(timeRunning=(datetime.now(timezone.utc) - self._start_time).seconds) | |||
payload = ShutdownPayload(time_running=(datetime.now(timezone.utc) - self._start_time).seconds) | |||
await self._queue_event(payload) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it go through self.send_telemetry_data
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow.. I think it should. Good catch.
"D1", # Missing docstrings | ||
"N", | ||
"N999", # Invalid module names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All component module names are PascalCase (eg. langflow.components.vectorstores.AstraDB
)
I'm not sure if we can change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add ruff rules for naming (N)