diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 727b6fa..cb84576 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,12 +16,12 @@ repos: - id: trailing-whitespace - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.1.4" + rev: "2.2.1" hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.5.5' + rev: 'v0.5.6' hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix, --show-fixes] diff --git a/tap_circle_ci/client.py b/tap_circle_ci/client.py index e9d7c52..09b37b4 100644 --- a/tap_circle_ci/client.py +++ b/tap_circle_ci/client.py @@ -55,7 +55,11 @@ def get_url_params( context: dict | None, next_page_token: str | None, ) -> dict[str, Any]: - """Return a dictionary of values to be used in URL parameterization.""" + """Get URL query parameters. + + Returns: + A dictionary of values to be used in URL parameterization. + """ params: dict = {} if next_page_token: params["page-token"] = next_page_token diff --git a/tap_circle_ci/streams.py b/tap_circle_ci/streams.py index d9f1967..d91742f 100644 --- a/tap_circle_ci/streams.py +++ b/tap_circle_ci/streams.py @@ -28,7 +28,11 @@ class PipelinesStream(CircleCIStream): @override def get_child_context(self, record: dict, context: dict | None) -> dict: - """Return a context dictionary for child streams.""" + """Return a context dictionary for child streams. + + Returns: + A dictionary with the context values. + """ return {"pipeline_id": record["id"], "project_slug": record["project_slug"]} @override @@ -37,7 +41,11 @@ def get_url_params( context: dict | None, next_page_token: str | None, ) -> dict[str, t.Any]: - """Return a dictionary of values to be used in URL parameterization.""" + """Get URL query parameters. + + Returns: + A dictionary with the URL parameters. + """ params = super().get_url_params(context, next_page_token) params["org-slug"] = self.config.get("org_slug") return params @@ -54,7 +62,11 @@ class WorkflowsStream(CircleCIStream): @override def get_child_context(self, record: dict, context: dict | None) -> dict: - """Return a context dictionary for child streams.""" + """Return a context dictionary for child streams. + + Returns: + A dictionary with the context values. + """ return {"workflow_id": record["id"]} @@ -69,7 +81,11 @@ class JobsStream(CircleCIStream): @override def post_process(self, row: dict, context: dict | None = None) -> dict | None: - """Add the Workflow ID to the row.""" + """Add the Workflow ID to the row. + + Returns: + The row with the transformed data. + """ if row and context: row["_workflow_id"] = context["workflow_id"] return row diff --git a/tap_circle_ci/tap.py b/tap_circle_ci/tap.py index 86e25f7..49aa4c8 100644 --- a/tap_circle_ci/tap.py +++ b/tap_circle_ci/tap.py @@ -17,7 +17,11 @@ class TapCircleCI(Tap): @classproperty def config_jsonschema(cls): # noqa: ANN201, N805 - """Return a list of configuration properties read by the tap.""" + """Return a list of configuration properties read by the tap. + + Returns: + A JSON schema object. + """ return th.PropertiesList( th.Property( "token", @@ -50,7 +54,11 @@ def config_jsonschema(cls): # noqa: ANN201, N805 ).to_dict() def discover_streams(self) -> list[Stream]: - """Return a list of discovered streams.""" + """Return a list of discovered streams. + + Returns: + A list of stream instances. + """ return [ streams.JobsStream(tap=self), streams.PipelinesStream(tap=self),