Skip to content

Commit dbcd38c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 2b3f35b commit dbcd38c

231 files changed

Lines changed: 1357 additions & 1515 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@
4242

4343
## Checklist
4444

45-
I have read and understood the [Contribution Guidelines]().
45+
I have read and understood the [Contribution Guidelines]().

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,4 @@ backend/backend/utils/load_models/yaml_models.yaml
213213

214214
# macOS
215215
.DS_Store
216-
**/.DS_Store
216+
**/.DS_Store

backend/backend/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from dotenv import load_dotenv
22

3-
from .celery import app as celery_app
3+
from backend.backend.celery import app as celery_app
44

55
load_dotenv()
66
__all__ = ["celery_app"]

backend/backend/account/authentication_controller.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Authentication controller that delegates to plugin or OSS service.
22
3-
Uses the same interface as ScalekitService for compatibility.
4-
If an authentication plugin is available (cloud), it uses the plugin.
3+
Uses the same interface as ScalekitService for compatibility. If an
4+
authentication plugin is available (cloud), it uses the plugin.
55
Otherwise, it falls back to the default AuthenticationService (OSS).
66
"""
77

@@ -179,8 +179,9 @@ def invite_user(
179179
) -> list:
180180
"""Invite user(s) to organization.
181181
182-
Accepts either a user_list (from the view) or a single email+role.
183-
Returns a list of {email, status, message} dicts for failed invites.
182+
Accepts either a user_list (from the view) or a single
183+
email+role. Returns a list of {email, status, message} dicts for
184+
failed invites.
184185
"""
185186
if user_list is None and email:
186187
user_list = [{"email": email, "role": role}]
@@ -207,8 +208,9 @@ def remove_users_from_organization(
207208
) -> list:
208209
"""Remove users from organization by email.
209210
210-
Looks up users by email, deletes their OrganizationMember records,
211-
and delegates to auth service for any cloud-specific cleanup.
211+
Looks up users by email, deletes their OrganizationMember
212+
records, and delegates to auth service for any cloud-specific
213+
cleanup.
212214
213215
Returns a list of failed removals.
214216
"""
@@ -397,8 +399,8 @@ def delete_user_invitation(
397399
def _resolve_role_name(role: str) -> str:
398400
"""Resolve a role_id to its role name if needed.
399401
400-
If 'role' is already a name (e.g. 'admin'), return as-is.
401-
If 'role' is a role_id (e.g. 'rol_123'), look up the Roles table.
402+
If 'role' is already a name (e.g. 'admin'), return as-is. If
403+
'role' is a role_id (e.g. 'rol_123'), look up the Roles table.
402404
"""
403405
try:
404406
from pluggable_apps.user_access_control.models.roles import Roles
@@ -414,8 +416,8 @@ def add_user_role(
414416
) -> Optional[dict]:
415417
"""Change a user's role in an organization.
416418
417-
Looks up the user by email, updates the OrganizationMember record,
418-
and delegates to Scalekit if available.
419+
Looks up the user by email, updates the OrganizationMember
420+
record, and delegates to Scalekit if available.
419421
"""
420422
from backend.core.models.organization_member import OrganizationMember
421423
from django.contrib.auth import get_user_model

backend/backend/account/authentication_service.py

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Authentication service for OSS mode.
22
33
Follows the same interface as ScalekitService to ensure compatibility.
4-
Handles user signup, login, logout, and session management using Django's
5-
built-in authentication system.
4+
Handles user signup, login, logout, and session management using
5+
Django's built-in authentication system.
66
"""
77

88
import logging
@@ -41,7 +41,8 @@ class AuthenticationService:
4141
"""Authentication service for OSS mode.
4242
4343
Implements the same interface as ScalekitService for compatibility.
44-
Provides signup, login, logout, and session management using Django sessions.
44+
Provides signup, login, logout, and session management using Django
45+
sessions.
4546
"""
4647

4748
def __init__(self) -> None:
@@ -338,13 +339,19 @@ def get_roles(self) -> list:
338339
def add_organization_user_role(
339340
self, organization_id: str, user: Any, user_role_name: str
340341
) -> Optional[list]:
341-
"""Add role to user. OSS stub."""
342+
"""Add role to user.
343+
344+
OSS stub.
345+
"""
342346
return None # Not supported in OSS
343347

344348
def assign_role_to_org_user(
345349
self, organization_id: str, user: Any, user_role_name: str = "admin"
346350
) -> list:
347-
"""Assign role to organization user. OSS stub."""
351+
"""Assign role to organization user.
352+
353+
OSS stub.
354+
"""
348355
return [] # Not supported in OSS
349356

350357
def get_organization_role_of_user(
@@ -360,13 +367,19 @@ def get_organization_role_of_user(
360367
def invite_user(
361368
self, admin: Any, org_id: str, email: str, role: str = "admin"
362369
) -> bool:
363-
"""Invite a user to organization. OSS stub."""
370+
"""Invite a user to organization.
371+
372+
OSS stub.
373+
"""
364374
return False # Not supported in OSS
365375

366376
def remove_users_from_organization(
367377
self, admin: Any, organization_id: str, user_emails: list
368378
) -> list:
369-
"""Remove users from organization. OSS stub."""
379+
"""Remove users from organization.
380+
381+
OSS stub.
382+
"""
370383
return [] # Not supported in OSS
371384

372385
def get_organizations_users(self, org_id: str) -> list:
@@ -380,11 +393,17 @@ def get_organizations_users(self, org_id: str) -> list:
380393
]
381394

382395
def get_invitations(self, organization_id: str) -> list:
383-
"""Get pending invitations. OSS returns empty."""
396+
"""Get pending invitations.
397+
398+
OSS returns empty.
399+
"""
384400
return []
385401

386402
def delete_invitation(self, organization_id: str, invitation_id: str) -> bool:
387-
"""Delete invitation. OSS stub."""
403+
"""Delete invitation.
404+
405+
OSS stub.
406+
"""
388407
return False
389408

390409
# =========================================================================
@@ -418,11 +437,17 @@ def get_organizations_by_user_id(self, user_id: str) -> list:
418437
]
419438

420439
def create_roles(self, role: Any) -> Any:
421-
"""Create role. OSS stub."""
440+
"""Create role.
441+
442+
OSS stub.
443+
"""
422444
return None
423445

424446
def delete_role(self, role_id: str) -> bool:
425-
"""Delete role. OSS stub."""
447+
"""Delete role.
448+
449+
OSS stub.
450+
"""
426451
return False
427452

428453
def forgot_password(self, request: HttpRequest) -> Response:
@@ -550,7 +575,10 @@ def validate_reset_token(self, request: HttpRequest) -> Response:
550575
)
551576

552577
def reset_user_password(self, user: Any) -> Response:
553-
"""Reset user password. OSS stub (legacy interface)."""
578+
"""Reset user password.
579+
580+
OSS stub (legacy interface).
581+
"""
554582
return Response(
555583
status=status.HTTP_400_BAD_REQUEST,
556584
data={"error": "Password reset not supported in OSS mode."},

backend/backend/account/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
class DefaultOrg:
77
"""Default organization constants.
88
9-
Used for OSS mode when auto-creating a personal organization.
10-
Legacy mock user support retained for backward compatibility.
9+
Used for OSS mode when auto-creating a personal organization. Legacy
10+
mock user support retained for backward compatibility.
1111
"""
1212
# Legacy mock user support (for backward compatibility with env-based auth)
1313
ORGANIZATION_NAME = "default_org"

backend/backend/account/dto.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Data transfer objects for account module.
22
3-
These DTOs provide a common interface for both OSS and cloud authentication.
3+
These DTOs provide a common interface for both OSS and cloud
4+
authentication.
45
"""
56

67
from dataclasses import dataclass

backend/backend/application/config_parser/config_parser.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ class ConfigParser(BaseParser):
1010
_instances: dict[str, "ConfigParser"] = {}
1111

1212
def __new__(cls, model_data: dict[str, Any], file_name: str, *args, **kwargs) -> "ConfigParser":
13-
"""
14-
Overrides the __new__ method to implement a singleton pattern
15-
based on the file_name parameter.
13+
"""Overrides the __new__ method to implement a singleton pattern based
14+
on the file_name parameter.
1615
1716
Args:
1817
model_data (dict[str, Any]): Configuration data for the model.
@@ -91,7 +90,7 @@ def unique_keys(self) -> list[str]:
9190
@property
9291
def delta_strategy(self) -> dict[str, Any]:
9392
return self.incremental_config.get("delta_strategy", {})
94-
93+
9594
@property
9695
def reference(self) -> list[str]:
9796
if not self._reference:
@@ -100,8 +99,8 @@ def reference(self) -> list[str]:
10099

101100
@property
102101
def source_model(self) -> str | None:
103-
"""
104-
Returns the model name that produces this model's source table, if any.
102+
"""Returns the model name that produces this model's source table, if
103+
any.
105104
106105
This is set by validate_table_usage_references() when the source table
107106
matches another model's destination. It explicitly tracks which model

backend/backend/application/config_parser/sample_yaml.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,3 @@ transform:
149149
rename_column: []
150150

151151
reference: []
152-

backend/backend/application/config_parser/transformation_parser.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,25 +59,25 @@ def _create_transform_parser(
5959

6060
@property
6161
def transform_orders(self) -> list[str]:
62-
"""Returns list of transformation ID 's"""
62+
"""Returns list of transformation ID 's."""
6363
return self.get("transform_order", [])
6464

6565
def get_transforms(self) -> list[BaseParser]:
66-
"""
67-
Generate and yield transformation parsers in the order defined by the configuration.
68-
69-
This method processes the `transform_order` list and corresponding `transform` dictionary
66+
"""Generate and yield transformation parsers in the order defined by
67+
the configuration.
68+
69+
This method processes the `transform_order` list and corresponding `transform` dictionary
7070
from the configuration to create parser instances of appropriate types for each transformation.
71-
71+
7272
- It iterates through the `transform_order` to ensure transformations are applied sequentially.
7373
- For each transformation, it determines the type and maps it to the corresponding parser class.
74-
- Certain transformation types (`combine_columns`, `group`, `find_and_replace`, and `distinct`)
75-
require special handling for their configuration. These are instantiated with a modified
74+
- Certain transformation types (`combine_columns`, `group`, `find_and_replace`, and `distinct`)
75+
require special handling for their configuration. These are instantiated with a modified
7676
configuration structure.
7777
- Other transformations are instantiated normally with their respective configuration data.
78-
78+
7979
Yields:
80-
BaseParser: An instance of the transformation parser for each transformation in the order
80+
BaseParser: An instance of the transformation parser for each transformation in the order
8181
defined by `transform_order`.
8282
"""
8383
if self._transforms:

0 commit comments

Comments
 (0)