-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: script and moved feature preview out
- Loading branch information
Showing
3 changed files
with
27 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from cognite.client.utils._experimental import FeaturePreviewWarning | ||
|
||
FeaturePreviewWarning("alpha", "alpha", "Core Data Model").warn() |
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,23 @@ | ||
"""This script requires pygen to be installed. It generates typed classes for the core data model v1. | ||
`pip install cognite-pygen==0.99.28` | ||
""" | ||
|
||
from pathlib import Path | ||
|
||
from cognite.pygen._generator import generate_typed | ||
from tests.tests_integration.conftest import make_cognite_client | ||
|
||
THIS_REPO = Path(__file__).resolve().parent.parent | ||
|
||
OUTPUT_FILE = THIS_REPO / "cognite" / "client" / "data_classes" / "cdm" / "v1.py" | ||
|
||
|
||
def main() -> None: | ||
client = make_cognite_client(beta=False) | ||
|
||
generate_typed(("cdf_cdm_experimental", "core_data_model", "v1"), OUTPUT_FILE, client, format_code=False) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |