-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adding version * formatting * added versions to metadata of generated schemas * testing generated_with * test for optional columns * renamed na_limit to na_pct_below * adding to changelog * bumping version in pyproject.toml * formatted * import version only when needed * using importlib.metadata * fixing self.na_limit * fix * fixing version test * update cli * generate metadata upon initialisation * fixing package name * raising * substitute importlib_metadata if python=3.7 * test cli update * updating changelog * stdout * stdout * small refactor of extension check * out * removing qoute * cli
- Loading branch information
Showing
19 changed files
with
225 additions
and
51 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
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
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,8 @@ | ||
import sys | ||
|
||
if sys.version_info >= (3, 8): | ||
from typing import Final | ||
else: | ||
from typing_extensions import Final | ||
|
||
CURRENT_PROTOCOL_VERSION: Final = 2.0 |
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
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,42 @@ | ||
import sys | ||
from datetime import date | ||
from typing import Optional | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
from .config import CURRENT_PROTOCOL_VERSION | ||
|
||
|
||
class Generated_With(BaseModel): | ||
@property | ||
def dfschema(self) -> str: | ||
if sys.version_info >= (3, 8): | ||
from importlib.metadata import version | ||
else: | ||
from importlib_metadata import version | ||
|
||
return version("dfschema") | ||
|
||
@property | ||
def pandas(self) -> str: | ||
import pandas as pd | ||
|
||
return pd.__version__ | ||
|
||
|
||
class MetaData(BaseModel): | ||
protocol_version: float = Field( | ||
CURRENT_PROTOCOL_VERSION, description="protocol version of the schema" | ||
) | ||
version: Optional[str] = Field( | ||
date.today().strftime("%Y-%m-%d"), | ||
description="version of the schema", | ||
example="2022-06-12", | ||
) | ||
|
||
generated_with: Generated_With = Field( | ||
Generated_With(), description="version of packages schema was generated with" | ||
) | ||
custom_settings: Optional[dict] = Field( | ||
None, description="custom settings. does not affect any logic" | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "dfschema" | ||
version = "0.0.10" | ||
version = "0.0.11" | ||
description = "lightweight pandas.DataFrame schema" | ||
authors = ["Philipp <[email protected]>"] | ||
readme = "README.md" | ||
|
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
Oops, something went wrong.