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

Type hinting/annotation style #356

Open
roykoand opened this issue Jul 29, 2024 · 2 comments
Open

Type hinting/annotation style #356

roykoand opened this issue Jul 29, 2024 · 2 comments

Comments

@roykoand
Copy link
Contributor

Is there any type hinting style in datacontract-cli?

What do you think about usage of type hinting libraries/checkers in the CI of this repo? mypy?

Data contract specification module is a good example. Some Pydantic models are type hinted without using typing.Optional

ref: str = pyd.Field(default=None, alias="$ref")
ref_obj: Definition = pyd.Field(default=None, exclude=True)
title: str = None
type: str = None
format: str = None
required: bool = None
primary: bool = None
unique: bool = None
references: str = None
description: str = None
pii: bool = None
classification: str = None
pattern: str = None
minLength: int = None

and some with:
description: Optional[str] = None
type: Optional[str] = None
namespace: Optional[str] = None
title: Optional[str] = None
fields: Dict[str, Field] = {}

@jochenchrist
Copy link
Contributor

Certainly, a good idea.
Open to discuss mypy.

Would you be interested in preparing a PR?

@roykoand
Copy link
Contributor Author

@jochenchrist sure, would love to work on this but can't guarantee a quick work done. We probably ought to exclude some of the mypy checks... will see and discuss in PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants