[WEB-4805] fix: upgraded psycopgy packages to fix linting and removed unused imports (#7735)

* chore: update psycopg dependencies to version 3.2.9 in base requirements

* refactor: clean up unused imports across multiple files

* chore: update lxml dependency to version 6.0.0 in base requirements

* style: improve code readability by breaking long lines into multiple lines across several files

* style: enhance readability by breaking long lines in ModuleSerializer docstring
This commit is contained in:
Nikhil 2025-09-29 14:33:50 +05:30 committed by GitHub
parent e891482a97
commit 1fb22bd252
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 45 additions and 46 deletions

View file

@ -499,7 +499,7 @@ ISSUE_COMMENT_EXAMPLE = OpenApiExample(
name="IssueComment",
value={
"id": "550e8400-e29b-41d4-a716-446655440000",
"comment_html": "<p>This issue has been resolved by implementing OAuth 2.0 flow.</p>",
"comment_html": "<p>This issue has been resolved by implementing OAuth 2.0 flow.</p>", # noqa: E501
"comment_json": {
"type": "doc",
"content": [
@ -508,7 +508,7 @@ ISSUE_COMMENT_EXAMPLE = OpenApiExample(
"content": [
{
"type": "text",
"text": "This issue has been resolved by implementing OAuth 2.0 flow.",
"text": "This issue has been resolved by implementing OAuth 2.0 flow.", # noqa: E501
}
],
}
@ -551,7 +551,7 @@ ISSUE_ATTACHMENT_NOT_UPLOADED_EXAMPLE = OpenApiExample(
"error": "The asset is not uploaded.",
"status": False,
},
description="Error when trying to download an attachment that hasn't been uploaded yet",
description="Error when trying to download an attachment that hasn't been uploaded yet", # noqa: E501
)
# Intake Issue Response Examples
@ -733,7 +733,7 @@ SAMPLE_STATE = {
SAMPLE_COMMENT = {
"id": "550e8400-e29b-41d4-a716-446655440000",
"comment_html": "<p>This issue needs more investigation. I'll look into the database connection timeout.</p>",
"comment_html": "<p>This issue needs more investigation. I'll look into the database connection timeout.</p>", # noqa: E501
"created_at": "2024-01-15T14:20:00Z",
"actor": {"id": "550e8400-e29b-41d4-a716-446655440002", "display_name": "John Doe"},
}

View file

@ -336,7 +336,7 @@ ORDER_BY_PARAMETER = OpenApiParameter(
OpenApiExample(
name="State group",
value="state__group",
description="Order by state group (backlog, unstarted, started, completed, cancelled)",
description="Order by state group (backlog, unstarted, started, completed, cancelled)", # noqa: E501
),
OpenApiExample(
name="Assignee name",

View file

@ -221,7 +221,7 @@ EXTERNAL_ID_EXISTS_RESPONSE = OpenApiResponse(
OpenApiExample(
name="External ID Exists",
value={
"error": "Resource with the same external id and external source already exists",
"error": "Resource with the same external id and external source already exists", # noqa: E501
"id": "550e8400-e29b-41d4-a716-446655440000",
},
)

View file

@ -221,7 +221,8 @@ class GroupedOffsetPaginator(OffsetPaginator):
self.group_by_field_name = group_by_field_name
# Set the group by fields
self.group_by_fields = group_by_fields
# Set the count filter - this are extra filters that need to be passed to calculate the counts with the filters
# Set the count filter - this are extra filters that need to be passed
# to calculate the counts with the filters
self.count_filter = count_filter
def get_result(self, limit=50, cursor=None):
@ -434,7 +435,8 @@ class SubGroupedOffsetPaginator(OffsetPaginator):
self.sub_group_by_field_name = sub_group_by_field_name
self.sub_group_by_fields = sub_group_by_fields
# Set the count filter - this are extra filters that need to be passed to calculate the counts with the filters
# Set the count filter - this are extra filters that need
# to be passed to calculate the counts with the filters
self.count_filter = count_filter
def get_result(self, limit=30, cursor=None):

View file

@ -10,11 +10,11 @@ URL_PATTERN = re.compile(
r"(?:" # Non-capturing group for alternatives
r"https?://[^\s]+" # http:// or https:// followed by non-whitespace
r"|"
r"www\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*" # www.domain with proper length limits
r"www\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*" # noqa: E501
r"|"
r"(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}" # domain.tld with length limits
r"(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}" # noqa: E501
r"|"
r"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" # IP address with proper validation
r"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" # noqa: E501
r")"
)
@ -85,7 +85,10 @@ def get_url_components(url: str) -> Optional[dict]:
Example:
>>> get_url_components("https://example.com/path?query=1")
{'scheme': 'https', 'netloc': 'example.com', 'path': '/path', 'params': '', 'query': 'query=1', 'fragment': ''}
{
'scheme': 'https', 'netloc': 'example.com',
'path': '/path', 'params': '',
'query': 'query=1', 'fragment': ''}
"""
if not is_valid_url(url):
return None
@ -102,9 +105,11 @@ def get_url_components(url: str) -> Optional[dict]:
def normalize_url_path(url: str) -> str:
"""
Normalize the path component of a URL by replacing multiple consecutive slashes with a single slash.
Normalize the path component of a URL by
replacing multiple consecutive slashes with a single slash.
This function preserves the protocol, domain, query parameters, and fragments of the URL,
This function preserves the protocol, domain,
query parameters, and fragments of the URL,
only modifying the path portion to ensure there are no duplicate slashes.
Args: