Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
andres-torres-marroquin committed Dec 10, 2024
1 parent 4d99819 commit dc0d8b9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
description: Detect hardcoded secrets pre-commit using Gitleaks
entry: gitleaks protect --verbose --no-banner --redact --staged
language: system
stages: [commit]
stages: [pre-commit]

- id: gitleaks-pre-push
# To use this pre-push hook, run
Expand All @@ -20,4 +20,4 @@ repos:
description: Detect hardcoded secrets pre-push using Gitleaks
entry: gitleaks detect --verbose --no-banner --redact --log-opts "origin..HEAD"
language: system
stages: [push]
stages: [pre-push]
7 changes: 5 additions & 2 deletions src/fides/api/models/connectionconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,13 @@ def authorized(self) -> bool:
return False

# hard-coding to avoid cyclic dependency
if authentication.strategy not in ["oauth2_authorization_code", "oauth2_client_credentials"]:
if authentication.strategy not in [
"oauth2_authorization_code",
"oauth2_client_credentials",
]:
return False

return bool(self.secrets and 'access_token' in self.secrets.keys())
return bool(self.secrets and "access_token" in self.secrets.keys())

@property
def name_or_key(self) -> str:
Expand Down
16 changes: 12 additions & 4 deletions src/fides/api/schemas/custom_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ class CustomReportConfig(FidesSchema):
default_factory=dict, description="A map between column keys and custom labels"
)

@computed_field
@computed_field # type: ignore[misc]
@property
def columns_to_skip(self) -> Set[str]:
return {key for key, value in self.column_map.items() if value.enabled is False}
return {
key
for key, value in self.column_map.items() # pylint: disable=no-member
if value.enabled is False
}

@computed_field
@computed_field # type: ignore[misc]
@property
def custom_column_labels(self) -> Dict[str, str]:
return {key: value.label for key, value in self.column_map.items() if value.label}
return {
key: value.label
for key, value in self.column_map.items() # pylint: disable=no-member
if value.label
}

0 comments on commit dc0d8b9

Please sign in to comment.