Skip to content

Commit

Permalink
chore: execute pre-commit autoupdate manually (#5029)
Browse files Browse the repository at this point in the history
# Description

Only executing `pre-commit autoupdate` manually to dependencies are
updated.

**Type of change**

(Please delete options that are not relevant. Remember to title the PR
according to the type of change)

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (change restructuring the codebase without changing
functionality)
- [ ] Improvement (change adding some improvement to an existing
functionality)
- [ ] Documentation update

**How Has This Been Tested**

(Please describe the tests that you ran to verify your changes. And
ideally, reference `tests`)

- [ ] Test A
- [ ] Test B

**Checklist**

- [ ] I added relevant documentation
- [ ] follows the style guidelines of this project
- [ ] I did a self-review of my code
- [ ] I made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I filled out [the contributor form](https://tally.so/r/n9XrxK)
(see text above)
- [ ] I have added relevant notes to the CHANGELOG.md file (See
https://keepachangelog.com/)

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
jfcalvo and pre-commit-ci[bot] authored Jun 14, 2024
1 parent f569e8d commit 0927fa5
Show file tree
Hide file tree
Showing 33 changed files with 53 additions and 49 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.4
rev: v0.4.8
hooks:
- id: ruff-format

##############################################################################
# argilla specific hooks
##############################################################################
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.4
rev: v0.4.8
hooks:
- id: ruff
files: 'argilla/src/.*\.py$'
args:
- --fix
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.4
rev: v1.5.5
hooks:
- id: insert-license
name: "Insert license header in Python source files"
Expand Down Expand Up @@ -52,7 +52,7 @@ repos:
# argilla-server specific hooks
##############################################################################
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.4
rev: v0.4.8
hooks:
- id: ruff
files: 'argila-server/src/.*\.py$'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-02-14 10:36:56.313539
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-07-24 12:47:11.715011
"""

from alembic import op

# revision identifiers, used by Alembic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-04-03 17:24:53.836750
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-06-27 17:34:49.734260
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-06-14 13:02:41.735153
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-02-13 17:08:05.445314
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-09-12 16:21:14.321044
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-09-22 11:40:07.700301
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-02-13 18:00:04.369604
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-10-19 16:06:16.097130
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-04-13 12:56:56.456664
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-06-23 15:55:19.928164
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-04-21 16:10:27.320399
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.sql import expression
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-09-29 13:51:44.525944
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-03-29 17:26:25.432467
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-09-21 15:41:59.642012
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2024-04-08 13:14:48.437677
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Create Date: 2023-04-13 14:48:52.462570
"""

import sqlalchemy as sa
from alembic import op

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async def _reindex(feedback_dataset_id: Optional[UUID] = None) -> None:


def reindex(
feedback_dataset_id: Optional[UUID] = typer.Option(None, help="The id of a feedback dataset to be reindexed")
feedback_dataset_id: Optional[UUID] = typer.Option(None, help="The id of a feedback dataset to be reindexed"),
) -> None:
asyncio.run(_reindex(feedback_dataset_id))

Expand Down
1 change: 1 addition & 0 deletions argilla-server/src/argilla_server/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
Common helper functions
"""

import logging

_LOGGER = logging.getLogger("argilla_server")
Expand Down
1 change: 0 additions & 1 deletion argilla-server/src/argilla_server/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

# TODO: Remove this and provide a file to configure logging


import logging
from logging import Logger, StreamHandler
from typing import Type
Expand Down
1 change: 1 addition & 0 deletions argilla-server/src/argilla_server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
Common environment vars / settings
"""

import logging
import os
import re
Expand Down
2 changes: 1 addition & 1 deletion argilla-server/src/argilla_server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Params(BaseModel):
query_param_typing = Optional[List[str]]

def _parse(
param_values: Optional[query_param_typing] = Query(None, alias=name, **kwargs)
param_values: Optional[query_param_typing] = Query(None, alias=name, **kwargs),
) -> Union[Dict[str, Any], T, None]:
if param_values is None:
return None
Expand Down
2 changes: 1 addition & 1 deletion argilla-server/src/argilla_server/utils/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class Params(BaseModel):
query_param_typing = Optional[List[str]]

def _parse(
param_values: Optional[query_param_typing] = Query(None, alias=name, **kwargs)
param_values: Optional[query_param_typing] = Query(None, alias=name, **kwargs),
) -> Union[Dict[str, Any], T, None]:
if param_values is None:
return None
Expand Down
2 changes: 1 addition & 1 deletion argilla-v1/src/argilla_v1/client/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ def _to_datasets_dict(self) -> Dict:

# create a dict first, where we make the necessary transformations
def entities_to_dict(
entities: Optional[List[Union[Tuple[str, int, int, float], Tuple[str, int, int]]]]
entities: Optional[List[Union[Tuple[str, int, int, float], Tuple[str, int, int]]]],
) -> Optional[List[Dict[str, Union[str, int, float]]]]:
if entities is None:
return None
Expand Down
6 changes: 3 additions & 3 deletions argilla-v1/src/argilla_v1/client/feedback/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class DatasetConfig(BaseModel):
fields: List[AllowedFieldTypes]
questions: List[Annotated[AllowedQuestionTypes, Field(..., discriminator="type")]]
guidelines: Optional[str] = None
metadata_properties: Optional[
List[Annotated[AllowedMetadataPropertyTypes, Field(..., discriminator="type")]]
] = None
metadata_properties: Optional[List[Annotated[AllowedMetadataPropertyTypes, Field(..., discriminator="type")]]] = (
None
)
allow_extra_metadata: bool = True
vectors_settings: Optional[List[VectorSettings]] = None

Expand Down
4 changes: 2 additions & 2 deletions argilla-v1/src/argilla_v1/client/feedback/dataset/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def validate_questions(questions: typing.Union[AllowedQuestionTypes, typing.List


def validate_metadata_properties(
metadata_properties: typing.Union[typing.List[AllowedMetadataPropertyTypes], None]
metadata_properties: typing.Union[typing.List[AllowedMetadataPropertyTypes], None],
) -> None:
"""Validates that the metadata properties used in the filters are valid."""

Expand Down Expand Up @@ -142,7 +142,7 @@ def validate_vector_names(dataset: "FeedbackDatasetBase", names: typing.List[str


def normalize_records(
records: Union[FeedbackRecord, Dict[str, Any], List[Union[FeedbackRecord, Dict[str, Any]]]]
records: Union[FeedbackRecord, Dict[str, Any], List[Union[FeedbackRecord, Dict[str, Any]]]],
) -> List[FeedbackRecord]:
"""Parses the records into a list of `FeedbackRecord` objects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""This module contains metrics to gather information related to inter-Annotator agreement. """
"""This module contains metrics to gather information related to inter-Annotator agreement."""

import warnings
from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Union

Expand Down
15 changes: 5 additions & 10 deletions argilla-v1/src/argilla_v1/client/feedback/schemas/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def title_must_have_value(cls, v: Optional[str], values: Dict[str, Any]) -> str:

@property
@abstractmethod
def server_settings(self) -> Dict[str, Any]:
...
def server_settings(self) -> Dict[str, Any]: ...

def to_server_payload(self) -> Dict[str, Any]:
return {
Expand All @@ -83,20 +82,17 @@ def to_server_payload(self) -> Dict[str, Any]:

@property
@abstractmethod
def _pydantic_field_with_validator(self) -> Tuple[Dict[str, Tuple[Any, ...]], Dict[str, Callable]]:
...
def _pydantic_field_with_validator(self) -> Tuple[Dict[str, Tuple[Any, ...]], Dict[str, Callable]]: ...

@abstractmethod
def _validate_filter(self, metadata_filter: "MetadataFilters") -> None:
pass

@abstractmethod
def _check_allowed_value_type(self, value: Any) -> Any:
...
def _check_allowed_value_type(self, value: Any) -> Any: ...

@abstractmethod
def _validator(self, value: Any) -> Any:
...
def _validator(self, value: Any) -> Any: ...


def _validator_definition(schema: MetadataPropertySchema) -> Dict[str, Any]:
Expand Down Expand Up @@ -394,8 +390,7 @@ class Config:

@property
@abstractmethod
def query_string(self) -> str:
...
def query_string(self) -> str: ...


class TermsMetadataFilter(MetadataFilterSchema):
Expand Down
1 change: 1 addition & 0 deletions argilla-v1/src/argilla_v1/client/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""
This module contains the data models for the interface
"""

import datetime
import logging
import uuid
Expand Down
24 changes: 8 additions & 16 deletions argilla/src/argilla/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,11 @@ def __iter__(self):

@overload
@abstractmethod
def __getitem__(self, index: int) -> "User":
...
def __getitem__(self, index: int) -> "User": ...

@overload
@abstractmethod
def __getitem__(self, index: slice) -> Sequence["User"]:
...
def __getitem__(self, index: slice) -> Sequence["User"]: ...

def __getitem__(self, index):
model = self._api.list()[index]
Expand All @@ -149,12 +147,10 @@ def add(self, user: "User") -> "User":
return user.create()

@overload
def list(self) -> List["User"]:
...
def list(self) -> List["User"]: ...

@overload
def list(self, workspace: "Workspace") -> List["User"]:
...
def list(self, workspace: "Workspace") -> List["User"]: ...

def list(self, workspace: Optional["Workspace"] = None) -> List["User"]:
"""List all users."""
Expand Down Expand Up @@ -206,13 +202,11 @@ def __iter__(self):

@overload
@abstractmethod
def __getitem__(self, index: int) -> "Workspace":
...
def __getitem__(self, index: int) -> "Workspace": ...

@overload
@abstractmethod
def __getitem__(self, index: slice) -> Sequence["Workspace"]:
...
def __getitem__(self, index: slice) -> Sequence["Workspace"]: ...

def __getitem__(self, index) -> "Workspace":
model = self._api.list()[index]
Expand Down Expand Up @@ -286,13 +280,11 @@ def __iter__(self):

@overload
@abstractmethod
def __getitem__(self, index: int) -> "Dataset":
...
def __getitem__(self, index: int) -> "Dataset": ...

@overload
@abstractmethod
def __getitem__(self, index: slice) -> Sequence["Dataset"]:
...
def __getitem__(self, index: slice) -> Sequence["Dataset"]: ...

def __getitem__(self, index) -> "Dataset":
model = self._api.list()[index]
Expand Down
Loading

0 comments on commit 0927fa5

Please sign in to comment.