-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚑 fixes graphql parser --use-standard-collections --use-union-operato…
…r --use-annotated (#2016) * 🩹 fixes graphql parser use-standard-collections and use-union-operator * 🩹 fixes graphql parser to use annoteted on typename fields * ♻️ refactors tests * ♻️ refactors tests Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors tests Signed-off-by: bpsoos <soos.peter.96@gmail.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * 🩹 fixes failing test Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors test_main into multiple files Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors test_main into multiple files Signed-off-by: bpsoos <soos.peter.96@gmail.com> * 🩹 fixes msgspec output file name Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors jsonschema expectations Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors jsonschema expectations Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors jsonschema expectations Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors openapi expectations Signed-off-by: bpsoos <soos.peter.96@gmail.com> * ♻️ refactors csv json yaml and general expectations Signed-off-by: bpsoos <soos.peter.96@gmail.com> * Fix test coverage (#2020) * Fix test coverage * Fix test coverage * Update output.py * Fix test coverage * Fix coverage * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix coverage * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix coverage * Fix coverage * Fix coverage * Fix coverage * Fix coverage * Fix coverage * Fix coverage * Fix coverage * Fix coverage * Fix coverage --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix coverage (#2023) * Fix coverage * Fix coverage * docs: Update airbyte use case + fix broken link (#2021) Co-authored-by: Koudai Aono <koxudaxi@gmail.com> * formats * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: bpsoos <soos.peter.96@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Koudai Aono <koxudaxi@gmail.com> Co-authored-by: Natik Gadzhi <natik@respawn.io>
- Loading branch information
1 parent
202c0b8
commit e4fa23a
Showing
427 changed files
with
7,146 additions
and
6,997 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# generated by datamodel-codegen: | ||
# filename: annotated.graphql | ||
# timestamp: 2019-07-26T00:00:00+00:00 | ||
|
||
from __future__ import annotations | ||
|
||
from typing import List, Optional, TypeAlias | ||
|
||
from pydantic import BaseModel, Field | ||
from typing_extensions import Annotated, Literal | ||
|
||
Boolean: TypeAlias = bool | ||
""" | ||
The `Boolean` scalar type represents `true` or `false`. | ||
""" | ||
|
||
|
||
String: TypeAlias = str | ||
""" | ||
The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. | ||
""" | ||
|
||
|
||
class A(BaseModel): | ||
field: String | ||
listField: List[String] | ||
listListField: List[List[String]] | ||
typename__: Annotated[Optional[Literal['A']], Field(alias='__typename')] = 'A' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions
28
tests/data/expected/main/graphql/use_standard_collections.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# generated by datamodel-codegen: | ||
# filename: use-standard-collections.graphql | ||
# timestamp: 2019-07-26T00:00:00+00:00 | ||
|
||
from __future__ import annotations | ||
|
||
from typing import Optional, TypeAlias | ||
|
||
from pydantic import BaseModel, Field | ||
from typing_extensions import Literal | ||
|
||
Boolean: TypeAlias = bool | ||
""" | ||
The `Boolean` scalar type represents `true` or `false`. | ||
""" | ||
|
||
|
||
String: TypeAlias = str | ||
""" | ||
The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. | ||
""" | ||
|
||
|
||
class A(BaseModel): | ||
field: String | ||
listField: list[String] | ||
listListField: list[list[String]] | ||
typename__: Optional[Literal['A']] = Field('A', alias='__typename') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# generated by datamodel-codegen: | ||
# filename: use-union-operator.graphql | ||
# timestamp: 2019-07-26T00:00:00+00:00 | ||
|
||
from __future__ import annotations | ||
|
||
from typing import List, TypeAlias | ||
|
||
from pydantic import BaseModel, Field | ||
from typing_extensions import Literal | ||
|
||
Boolean: TypeAlias = bool | ||
""" | ||
The `Boolean` scalar type represents `true` or `false`. | ||
""" | ||
|
||
|
||
String: TypeAlias = str | ||
""" | ||
The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. | ||
""" | ||
|
||
|
||
class A(BaseModel): | ||
field: String | ||
listField: List[String] | ||
listListField: List[List[String]] | ||
listListOptionalField: List[List[String | None]] | ||
listOptionalField: List[String | None] | ||
listOptionalListField: List[List[String] | None] | ||
listOptionalListOptionalField: List[List[String | None] | None] | ||
optionalField: String | None = None | ||
optionalListListField: List[List[String]] | None = Field(default_factory=list) | ||
optionalListListOptionalField: List[List[String | None]] | None = Field( | ||
default_factory=list | ||
) | ||
optionalListOptionalField: List[String | None] | None = Field(default_factory=list) | ||
optionalListOptionalListField: List[List[String] | None] | None = Field( | ||
default_factory=list | ||
) | ||
typename__: Literal['A'] | None = Field('A', alias='__typename') |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# generated by datamodel-codegen: | ||
# filename: person.json | ||
# timestamp: 2019-07-26T00:00:00+00:00 | ||
|
||
# MIT License | ||
# | ||
# Copyright (c) 2023 Blah-blah | ||
# | ||
from __future__ import annotations | ||
|
||
from typing import List, Optional | ||
|
||
from pydantic import BaseModel, Field, conint | ||
|
||
|
||
class Person(BaseModel): | ||
firstName: Optional[str] = Field(None, description="The person's first name.") | ||
lastName: Optional[str] = Field(None, description="The person's last name.") | ||
age: Optional[conint(ge=0)] = Field( | ||
None, description='Age in years which must be equal to or greater than zero.' | ||
) | ||
friends: Optional[List] = None | ||
comment: None = None |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.