Skip to content

Commit

Permalink
build(deps-dev): bump ruff from 0.7.4 to 0.8.0 in the dev-deps group (#…
Browse files Browse the repository at this point in the history
…1832)

* build(deps-dev): bump ruff from 0.7.4 to 0.8.0 in the dev-deps group

Bumps the dev-deps group with 1 update: [ruff](https://github.com/astral-sh/ruff).


Updates `ruff` from 0.7.4 to 0.8.0
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.7.4...0.8.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: dev-deps
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: make format

Signed-off-by: Luka Peschke <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Luka Peschke <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luka Peschke <[email protected]>
  • Loading branch information
dependabot[bot] and lukapeschke authored Nov 25, 2024
1 parent 68520f9 commit a9e4fc6
Show file tree
Hide file tree
Showing 42 changed files with 125 additions and 126 deletions.
40 changes: 20 additions & 20 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ all = [
]

[tool.poetry.group.dev.dependencies]
ruff = ">=0.6.1,<0.8.0"
ruff = ">=0.6.1,<0.9.0"
pre-commit = ">=3.6,<5.0"
types-oauthlib = "^3.2.0.20240217"

Expand Down
4 changes: 2 additions & 2 deletions tests/awsathena/test_awsathena.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import List, Optional
from typing import Optional
from unittest.mock import MagicMock

import pandas as pd
Expand Down Expand Up @@ -48,7 +48,7 @@ def mocked_boto_session(mocker):


@pytest.fixture
def status_checks() -> List[str]:
def status_checks() -> list[str]:
return [
"Host resolved",
"Port opened",
Expand Down
3 changes: 2 additions & 1 deletion tests/google_big_query/test_google_big_query.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
from collections.abc import Generator
from os import environ
from typing import Any, Generator
from typing import Any
from unittest.mock import patch

import numpy as np
Expand Down
3 changes: 2 additions & 1 deletion tests/s3/test_s3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import tempfile
from collections.abc import Generator
from datetime import datetime, timedelta
from typing import Any, Generator
from typing import Any

import openpyxl
import pandas as pd
Expand Down
3 changes: 1 addition & 2 deletions tests/test_connector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from time import time
from typing import List

import pandas as pd
import pytest
Expand Down Expand Up @@ -346,7 +345,7 @@ def get_model(
schema_name: str | None = None,
table_name: str | None = None,
exclude_columns: bool = False,
) -> List[TableInfo]:
) -> list[TableInfo]:
model = [("database", "schema", "type", "name", [{"name": "column", "type": "type"}])]
return DiscoverableConnector.format_db_model(model)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_query_manager.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Dict, Optional
from typing import Optional

import pytest

from toucan_connectors.query_manager import QueryManager


def fixture_execute_method(execute_method, query: str, query_parameters: Optional[Dict]):
def fixture_execute_method(execute_method, query: str, query_parameters: Optional[dict]):
return True


Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_datetime.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from datetime import date, datetime, timezone
from zoneinfo import ZoneInfo

import pandas as pd
import pytest
from dateutil import tz
from numpy import dtype
from zoneinfo import ZoneInfo

from toucan_connectors.utils.datetime import is_datetime_col, sanitize_df_dates

Expand Down
3 changes: 1 addition & 2 deletions toucan_connectors/awsathena/awsathena_connector.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import logging
from typing import Any
from typing import Annotated, Any

from cached_property import cached_property_with_ttl
from pydantic import ConfigDict, Field, StringConstraints, create_model
from typing_extensions import Annotated

try:
import awswrangler as wr
Expand Down
3 changes: 2 additions & 1 deletion toucan_connectors/azure_mssql/azure_mssql_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
getLogger(__name__).warning(f"Missing dependencies for {__name__}: {exc}")
CONNECTOR_OK = False

from typing import Annotated

from pydantic import Field, StringConstraints
from typing_extensions import Annotated

from toucan_connectors.common import pandas_read_sql
from toucan_connectors.toucan_connector import PlainJsonSecretStr, ToucanConnector, ToucanDataSource
Expand Down
3 changes: 2 additions & 1 deletion toucan_connectors/clickhouse/clickhouse_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
getLogger(__name__).warning(f"Missing dependencies for {__name__}: {exc}")
CONNECTOR_OK = False

from typing import Annotated

from pydantic import Field, StringConstraints, create_model
from pydantic.json_schema import DEFAULT_REF_TEMPLATE, GenerateJsonSchema, JsonSchemaMode
from typing_extensions import Annotated

from toucan_connectors.common import pandas_read_sql
from toucan_connectors.toucan_connector import (
Expand Down
8 changes: 4 additions & 4 deletions toucan_connectors/condition_translator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from abc import ABC, abstractmethod
from enum import Enum
from typing import Any, List, Literal, TypeVar, Union
from typing import Any, Literal, TypeVar, Union

from pydantic import BaseModel

Expand Down Expand Up @@ -86,7 +86,7 @@ def translate(cls, condition: dict):

@classmethod
@abstractmethod
def join_clauses(cls, clauses: List[ClauseType], logical_operator: LogicalOperator):
def join_clauses(cls, clauses: list[ClauseType], logical_operator: LogicalOperator):
"""
Join multiple clauses with `and` or `or`.
"""
Expand Down Expand Up @@ -142,13 +142,13 @@ def GREATER_THAN_EQUAL(cls, column: str, value: Number) -> ClauseType:

@classmethod
@abstractmethod
def IN(cls, column: str, values: List[str]) -> ClauseType:
def IN(cls, column: str, values: list[str]) -> ClauseType:
"""`column` values in `values`"""
raise NotImplementedError

@classmethod
@abstractmethod
def NOT_IN(cls, column: str, values: List[str]) -> ClauseType:
def NOT_IN(cls, column: str, values: list[str]) -> ClauseType:
"""`column` values not in `values`"""
raise NotImplementedError

Expand Down
4 changes: 2 additions & 2 deletions toucan_connectors/connection_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import time
import types
from enum import Enum
from typing import Dict, Optional, Union
from typing import Optional, Union

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -99,7 +99,7 @@ def force_to_remove(self):
class ConnectionManager:
def __init__(self, **kwargs):
self.name: str = "connection_manager"
self.connection_list: Dict[str, ConnectionBO] = {}
self.connection_list: dict[str, ConnectionBO] = {}

self.timeout = 5
self.wait = 0.2
Expand Down
5 changes: 2 additions & 3 deletions toucan_connectors/databricks/databricks_connector.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import logging
from typing import List, Optional, Tuple
from typing import Annotated, Optional

from pydantic import Field, StringConstraints
from typing_extensions import Annotated

from toucan_connectors.common import ClusterStartException, ConnectorStatus, pandas_read_sql
from toucan_connectors.toucan_connector import PlainJsonSecretStr, ToucanConnector, ToucanDataSource
Expand Down Expand Up @@ -69,7 +68,7 @@ def _build_connection_string(self) -> str:
return ";".join(f"{k}={v}" for k, v in connection_params.items() if v is not None)

@staticmethod
def _get_details(index: int, status: Optional[bool]) -> List[Tuple[str, bool]]:
def _get_details(index: int, status: Optional[bool]) -> list[tuple[str, bool]]:
checks = ["Host resolved", "Port opened", "Connected to Databricks", "Authenticated"]
ok_checks = [(c, True) for i, c in enumerate(checks) if i < index]
new_check = (checks[index], status)
Expand Down
3 changes: 1 addition & 2 deletions toucan_connectors/elasticsearch/elasticsearch_connector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from copy import deepcopy
from enum import Enum
from logging import getLogger
from typing import List
from urllib.parse import urlparse

try:
Expand Down Expand Up @@ -125,7 +124,7 @@ class ElasticsearchDataSource(ToucanDataSource):


class ElasticsearchConnector(ToucanConnector, data_source_model=ElasticsearchDataSource):
hosts: List[ElasticsearchHost]
hosts: list[ElasticsearchHost]

def _retrieve_data(self, data_source: ElasticsearchDataSource) -> "pd.DataFrame":
data_source.body = nosql_apply_parameters_to_query(data_source.body, data_source.parameters)
Expand Down
4 changes: 2 additions & 2 deletions toucan_connectors/github/github_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime
from enum import Enum
from pathlib import Path
from typing import List, Optional
from typing import Optional

from dateutil import relativedelta
from pydantic import Field, PrivateAttr, create_model
Expand Down Expand Up @@ -209,7 +209,7 @@ async def get_pages(
retries=0,
retry_limit=2,
latest_retrieved_object=None,
) -> List[dict]:
) -> list[dict]:
"""
Extracts pages of either members or pull requests
:param name a str representing the repo name
Expand Down
9 changes: 4 additions & 5 deletions toucan_connectors/github/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import logging
from datetime import datetime
from typing import List

import pandas as pd

Expand Down Expand Up @@ -199,7 +198,7 @@ def format_pr_row(pr_row: dict):
return current_record


def format_pr_rows(pr_nodes: dict, repo_name: str) -> List[dict]:
def format_pr_rows(pr_nodes: dict, repo_name: str) -> list[dict]:
"""
A wrapper function to multiprocess the pull requests formatting
:param pr_rows: pull requests extracted from Github's API
Expand Down Expand Up @@ -229,7 +228,7 @@ def format_team_row(members: dict, team_name: str) -> dict:
return devs.to_dict().get("variable")


def format_team_df(team_rows: List[dict]) -> pd.DataFrame:
def format_team_df(team_rows: list[dict]) -> pd.DataFrame:
"""
Builds a Pandas DataFrame from members rows.
:param team_rows: a list of dict with login as key and list
Expand Down Expand Up @@ -312,7 +311,7 @@ def get_teams(organization: dict):
raise KeyNotFoundException("No teams Key Available")


def get_nodes(response: dict) -> List[dict]:
def get_nodes(response: dict) -> list[dict]:
"""
Extracts value from a dict with nodes key or raises an error if the key is not available
:param response: a response from Github's API
Expand All @@ -322,7 +321,7 @@ def get_nodes(response: dict) -> List[dict]:
return nodes


def get_edges(data: dict) -> List[dict]:
def get_edges(data: dict) -> list[dict]:
"""
Extracts value from a dict with edges key or raises an error if the key is not available
:param data: data extracted from Github's API
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import logging
import re
from collections.abc import Iterable
from contextlib import suppress
from enum import Enum
from functools import cached_property
from itertools import groupby
from timeit import default_timer as timer
from typing import Any, Iterable, Union
from typing import Any, Union

from pydantic import ConfigDict, Field, create_model

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from logging import getLogger
from typing import Annotated

from pydantic import Field, StringConstraints
from typing_extensions import Annotated

try:
import pandas as pd
Expand Down
4 changes: 2 additions & 2 deletions toucan_connectors/google_sheets/google_sheets_connector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from contextlib import suppress
from datetime import datetime
from logging import getLogger
from typing import Any, Callable, List, Optional
from typing import Any, Callable, Optional

try:
import numpy as np
Expand Down Expand Up @@ -110,7 +110,7 @@ def build_sheets_api(self):
def build_oauth2(self):
return build("oauth2", "v2", cache_discovery=False, **self._google_client_build_kwargs())

def list_sheets(self, spreadsheet_id: str) -> List[str]:
def list_sheets(self, spreadsheet_id: str) -> list[str]:
"""
List available sheets
"""
Expand Down
4 changes: 2 additions & 2 deletions toucan_connectors/http_api/http_api_connector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
from enum import Enum
from logging import getLogger
from typing import Any, List
from typing import Any

from pydantic import AnyHttpUrl, BaseModel, Field, FilePath

Expand Down Expand Up @@ -78,7 +78,7 @@ class Template(BaseModel):
class HttpAPIConnector(ToucanConnector, data_source_model=HttpAPIDataSource):
responsetype: ResponseType = Field(ResponseType.json, title="Content-type of response")
baseroute: AnyHttpUrl = Field(..., title="Baseroute URL", description="Baseroute URL")
cert: List[FilePath] | None = Field(None, title="Certificate", description="File path of your certificate if any")
cert: list[FilePath] | None = Field(None, title="Certificate", description="File path of your certificate if any")
auth: Auth | None = Field(None, title="Authentication type")
template: Template | None = Field(
None,
Expand Down
3 changes: 2 additions & 1 deletion toucan_connectors/hubspot_private_app/hubspot_connector.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from collections.abc import Generator
from contextlib import suppress
from datetime import datetime
from logging import getLogger
from typing import Any, Generator, Protocol, TypeAlias
from typing import Any, Protocol, TypeAlias

from pydantic import BaseModel, ConfigDict, Field, create_model

Expand Down
Loading

0 comments on commit a9e4fc6

Please sign in to comment.