Skip to content

Commit 678a040

Browse files
committed
Merge branch 'main' into release/2.3.0
2 parents 7d862ad + 44e791f commit 678a040

File tree

120 files changed

+586
-447
lines changed

Some content is hidden

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

120 files changed

+586
-447
lines changed

.pre-commit-config.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ repos:
55
rev: v0.4.3
66
hooks:
77
- id: ruff
8-
args: [ --fix, --exit-non-zero-on-fix, --show-fixes ]
8+
args: [format, --diff]
99
- id: ruff-format
1010

1111
- repo: https://github.com/pre-commit/pre-commit-hooks
1212
rev: v4.4.0
1313
hooks:
14-
- id: end-of-file-fixer
15-
exclude_types: ["json"]
16-
- id: trailing-whitespace
17-
exclude_types: ["json"]
14+
- id: end-of-file-fixer
15+
exclude_types: ["json"]
16+
- id: trailing-whitespace
17+
exclude_types: ["json"]
1818

1919
- repo: local
2020
hooks:
21-
- id: check-tests-are-marked
22-
alias: check-tests-are-marked
23-
name: check-tests-are-marked
24-
entry: scripts/check-tests-are-marked.py
25-
language: python
26-
types: ["python"]
27-
files: "tests"
28-
exclude: "/conftest.py$"
29-
- id: check-docker-file-extension
30-
alias: docker-filename
31-
name: check-docker-file-extension
32-
entry: scripts/check-docker-extensions.py
33-
language: python
21+
- id: check-tests-are-marked
22+
alias: check-tests-are-marked
23+
name: check-tests-are-marked
24+
entry: scripts/check-tests-are-marked.py
25+
language: python
26+
types: ["python"]
27+
files: "tests"
28+
exclude: "/conftest.py$"
29+
- id: check-docker-file-extension
30+
alias: docker-filename
31+
name: check-docker-file-extension
32+
entry: scripts/check-docker-extensions.py
33+
language: python

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# DataOps Observability
2-
![apache 2.0 license Badge](https://img.shields.io/badge/License%20-%20Apache%202.0%20-%20blue) ![PRs Badge](https://img.shields.io/badge/PRs%20-%20Welcome%20-%20green) [![Docker Pulls](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhub.docker.com%2Fv2%2Frepositories%2Fdatakitchen%2Fdataops-testgen%2F&query=pull_count&style=flat&label=docker%20pulls&color=06A04A)](https://hub.docker.com/r/datakitchen/dataops-observability) [![Documentation](https://img.shields.io/badge/docs-On%20datakitchen.io-06A04A?style=flat)](https://docs.datakitchen.io/articles/#!dataops-observability-help/dataops-observability-help)
1+
# DataOps Observability
2+
![apache 2.0 license Badge](https://img.shields.io/badge/License%20-%20Apache%202.0%20-%20blue) ![PRs Badge](https://img.shields.io/badge/PRs%20-%20Welcome%20-%20green) [![Docker Pulls](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhub.docker.com%2Fv2%2Frepositories%2Fdatakitchen%2Fdataops-testgen%2F&query=pull_count&style=flat&label=docker%20pulls&color=06A04A)](https://hub.docker.com/r/datakitchen/dataops-observability) [![Documentation](https://img.shields.io/badge/docs-On%20datakitchen.io-06A04A?style=flat)](https://docs.datakitchen.io/articles/#!dataops-observability-help/dataops-observability-help)
33
[![Latest Version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fhub.docker.com%2Fv2%2Frepositories%2Fdatakitchen%2Fdataops-observability-be%2Ftags%2F&query=results%5B0%5D.name&label=latest%20version&color=06A04A)](https://hub.docker.com/r/datakitchen/dataops-observability-be)
44
[![Static Badge](https://img.shields.io/badge/Slack-Join%20Discussion-blue?style=flat&logo=slack)](https://data-observability-slack.datakitchen.io/join)
55

@@ -152,7 +152,7 @@ We recommend you start by going through the [Data Observability Overview Demo](h
152152
For support requests, [join the Data Observability Slack](https://data-observability-slack.datakitchen.io/join) and ask post on #support channel.
153153

154154
### Connect
155-
Talk and Learn with other data practitioners who are building with DataKitchen. Share knowledge, get help, and contribute to our open-source project.
155+
Talk and Learn with other data practitioners who are building with DataKitchen. Share knowledge, get help, and contribute to our open-source project.
156156

157157
Join our community here:
158158

agent_api/routes/v1_routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__all__ = ("build_v1_routes",)
22

3-
from typing import Callable
3+
from collections.abc import Callable
44

55
from flask import Blueprint, Flask
66

cli/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ def get_version(name: str = "cli") -> str:
1212
By default, get_version() always returns the vermin version but the **name** keyword
1313
argument can be passed to get version info for any installed package.
1414
"""
15-
1615
try:
1716
return version(name)
1817
except PackageNotFoundError:

cli/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
from argparse import ArgumentParser
55
from logging.config import dictConfig
66
from pathlib import Path
7-
from typing import Any, Callable, Optional
7+
from typing import Any, Optional
8+
from collections.abc import Callable
89

910
from log_color import ColorFormatter, ColorStripper
1011

cli/entry_points/database_schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import re
22
from argparse import ArgumentParser
3-
from typing import Any, Iterable, Optional, Pattern
3+
from typing import Any, Optional
4+
from re import Pattern
5+
from collections.abc import Iterable
46

57
from peewee import MySQLDatabase
68

cli/entry_points/gen_events.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import time
88
from argparse import Action, ArgumentParser, Namespace
99
from datetime import datetime
10-
from typing import Any, Optional, Sequence, Type, Union
10+
from typing import Any, Optional, Union
11+
from collections.abc import Sequence
1112

1213
from requests_extensions import get_session
1314

@@ -82,7 +83,7 @@ class RunStatusEvent(BaseEvent):
8283
}
8384

8485

85-
def make_events_action(event_id: str) -> Type[Action]:
86+
def make_events_action(event_id: str) -> type[Action]:
8687
class EventsAction(Action):
8788
def __call__(
8889
self,

cli/entry_points/init.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ def collect_user_input(fields: list[str]) -> dict[str, str]:
2323
while field not in res:
2424
if value := input(f"{field.capitalize()!s: >20}: "):
2525
res[field] = value
26-
except KeyboardInterrupt:
26+
except KeyboardInterrupt as ki:
2727
print("--\n") # Moving the cursor back to the start
28-
raise OperationAborted("Operation aborted by the user")
28+
raise OperationAborted("Operation aborted by the user") from ki
2929
return res
3030

3131

@@ -39,10 +39,10 @@ def read_json_input(fields: list[str]) -> dict[str, str]:
3939
json_input = json.loads(payload)
4040
for field in fields:
4141
res[field] = json_input[field]
42-
except KeyError as e:
43-
raise OperationAborted(f"'{e}' not found in the input data")
44-
except Exception:
45-
raise OperationAborted("Invalid input data")
42+
except KeyError as ke:
43+
raise OperationAborted(f"'{ke}' not found in the input data") from ke
44+
except Exception as e:
45+
raise OperationAborted("Invalid input data") from e
4646
return res
4747

4848

cli/entry_points/migration_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import contextlib
33
import sys
44
from argparse import ArgumentParser
5-
from typing import Iterator
5+
from collections.abc import Iterator
66

77
from peewee import ColumnMetadata, Database, MySQLDatabase, ProgrammingError
88

cli/entry_points/yoyo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ def apply_migrations(self, force: bool = False) -> None:
7070
else:
7171
LOG.info("Migration '%s' SUCCEEDED", migration.id)
7272
applied.append(migration)
73-
except Exception:
73+
except Exception as e:
7474
for migration in reversed(applied):
7575
LOG.info(" '-- Rolling back '%s'", migration.id)
7676
try:
7777
backend.rollback_one(migration, force=True)
7878
except Exception as rollback_exp:
7979
LOG.exception("Error rolling back migration '%s': %s", migration.id, rollback_exp)
8080

81-
raise OperationAborted("Migration failed. The new migrations have been rolled back")
81+
raise OperationAborted("Migration failed. The new migrations have been rolled back") from e
8282

8383
backend.run_post_apply(migrations, force=force)

0 commit comments

Comments
 (0)