Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format code with latest black #269

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions ariadne_codegen/client_generators/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,15 @@ def add_method(
raise NotSupported(
"Subscriptions are only available when using async client."
)
method_def: Union[
ast.FunctionDef, ast.AsyncFunctionDef
] = self._generate_subscription_method_def(
name=name,
operation_name=operation_name,
return_type=return_type,
arguments=arguments,
arguments_dict=arguments_dict,
operation_str=operation_str,
method_def: Union[ast.FunctionDef, ast.AsyncFunctionDef] = (
self._generate_subscription_method_def(
name=name,
operation_name=operation_name,
return_type=return_type,
arguments=arguments,
arguments_dict=arguments_dict,
operation_str=operation_str,
)
)
elif async_:
method_def = self._generate_async_method(
Expand Down
6 changes: 3 additions & 3 deletions ariadne_codegen/client_generators/result_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def parse_operation_field(
schema=schema,
field_node=field,
custom_scalars=custom_scalars if custom_scalars else {},
fragments_definitions=fragments_definitions
if fragments_definitions
else {},
fragments_definitions=(
fragments_definitions if fragments_definitions else {}
),
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@


class UnionA(BaseModel):
query_u: Union[
"UnionAQueryUTypeA", "UnionAQueryUTypeB", "UnionAQueryUTypeC"
] = Field(alias="queryU", discriminator="typename__")
query_u: Union["UnionAQueryUTypeA", "UnionAQueryUTypeB", "UnionAQueryUTypeC"] = (
Field(alias="queryU", discriminator="typename__")
)


class UnionAQueryUTypeA(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@


class UnionB(BaseModel):
query_u: Union[
"UnionBQueryUTypeA", "UnionBQueryUTypeB", "UnionBQueryUTypeC"
] = Field(alias="queryU", discriminator="typename__")
query_u: Union["UnionBQueryUTypeA", "UnionBQueryUTypeB", "UnionBQueryUTypeC"] = (
Field(alias="queryU", discriminator="typename__")
)


class UnionBQueryUTypeA(BaseModel):
Expand Down
8 changes: 2 additions & 6 deletions tests/main/clients/shorter_results/expected_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ async def list_type_a(
data = self.get_data(response)
return ListTypeA.model_validate(data).list_optional_type_a

async def get_animal_by_name(
self, name: str, **kwargs: Any
) -> Union[
async def get_animal_by_name(self, name: str, **kwargs: Any) -> Union[
GetAnimalByNameAnimalByNameAnimal,
GetAnimalByNameAnimalByNameCat,
GetAnimalByNameAnimalByNameDog,
Expand Down Expand Up @@ -163,9 +161,7 @@ async def get_animal_by_name(
data = self.get_data(response)
return GetAnimalByName.model_validate(data).animal_by_name

async def list_animals(
self, **kwargs: Any
) -> List[
async def list_animals(self, **kwargs: Any) -> List[
Union[
ListAnimalsListAnimalsAnimal,
ListAnimalsListAnimalsCat,
Expand Down
Loading