Skip to content

Commit

Permalink
ci: make CI compatible with black 23.1.0 (#337)
Browse files Browse the repository at this point in the history
* isort: ignore files listed in .gitignore

* reformat with black 23.1.0

* revert to explicit skipping as `make docker_test` does not use git
  • Loading branch information
lvaylet committed Mar 10, 2023
1 parent 23be0ce commit 80db44b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ profile = "black"
extend_skip = [
".pytype",
]
extend_skip_glob = [
"?venv*", # e.g. venv, .venv, venv3.11, .venv3.11
]

[tool.pylint]
ignore-patterns = [
Expand Down
2 changes: 1 addition & 1 deletion slo_generator/backends/datadog.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def query_slo(self, timestamp, window, slo_config):
valid_event_count = data["data"]["series"]["denominator"]["sum"]
bad_event_count = valid_event_count - good_event_count
return (good_event_count, bad_event_count)
except (KeyError) as exception: # monitor-based SLI
except KeyError as exception: # monitor-based SLI
sli_value = data["data"]["overall"]["sli_value"] / 100
LOGGER.debug(exception)
return sli_value
Expand Down
3 changes: 0 additions & 3 deletions slo_generator/migrations/migrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,15 @@ def report_v2tov1(report: dict) -> dict:
"""
mapped_report: dict = {}
for key, value in report.items():

# If a metadata label is passed, use the metadata label mapping
if key == "metadata":
mapped_report["metadata"] = {}
for subkey, subvalue in value.items():

# v2 `metadata.labels` attributes map to `metadata` attributes
# in v1
if subkey == "labels":
labels = subvalue
for labelkey, labelval in labels.items():

# Top-level labels like 'service_name', 'feature_name',
# and 'slo_name'.
if labelkey in METRIC_METADATA_LABELS_TOP_COMPAT:
Expand Down
2 changes: 0 additions & 2 deletions slo_generator/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class SLOReport:

# pylint: disable=too-many-arguments
def __init__(self, config, backend, step, timestamp, client=None, delete=False):

# Init dataclass fields from SLO config and Error Budget Policy
spec = config["spec"]
self.exporters = []
Expand Down Expand Up @@ -300,7 +299,6 @@ def _validate(self, data) -> bool:

# Good / Bad tuple
if isinstance(data, tuple):

# Tuple length should be 2
if len(data) != 2:
error = (
Expand Down

0 comments on commit 80db44b

Please sign in to comment.