Skip to content

Commit

Permalink
Gtw_fix_some_bugs (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregertw authored Oct 13, 2023
1 parent 56bed3e commit d74d021
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 26 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

**Please add new changelog items at the top!**

## Oct 13, 2023

- Fixed a bug in the restore_datamodel.py script making it pretty much useful for loading a data model dump.

## Oct 5, 2023

- Add support for dumping and loading of all data models, views, containers, and spaces, also
Expand Down
20 changes: 10 additions & 10 deletions {{cookiecutter.buildfolder}}/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion {{cookiecutter.buildfolder}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python = ">=3.11,<3.13"
cookiecutter = "^2.4.0"
click = "^8.1.7"
python-dotenv = "^1.0.0"
cognite-sdk = {version = "6.28.2", extras = ["pandas"]}
cognite-sdk = {version = "6.32.4", extras = ["pandas"]}
pandas = "^2.1.1"
pyyaml = "^6.0.1"
dacite = "^1.8.1"
Expand Down
21 changes: 11 additions & 10 deletions {{cookiecutter.buildfolder}}/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
arrow==1.2.3
arrow==1.3.0
binaryornot==0.4.4
certifi==2023.7.22
cffi==1.15.1
cffi==1.16.0
chardet==5.2.0
charset-normalizer==3.2.0
charset-normalizer==3.3.0
click==8.1.7
cognite-sdk[pandas]==6.25.3
cognite-sdk[pandas]==6.32.4
colorama==0.4.6
cookiecutter==2.3.0
cookiecutter==2.4.0
cryptography==41.0.4
dacite==1.8.1
idna==3.4
jinja2==3.1.2
markdown-it-py==3.0.0
markupsafe==2.1.3
mdurl==0.1.2
msal==1.24.0
msal==1.24.1
numpy==1.26.0
oauthlib==3.2.2
pandas==2.1.1
protobuf==4.24.3
protobuf==4.24.4
pycparser==2.21
pygments==2.16.1
pyjwt[crypto]==2.8.0
Expand All @@ -28,13 +28,14 @@ python-dotenv==1.0.0
python-slugify==8.0.1
pytz==2023.3.post1
pyyaml==6.0.1
regex==2023.8.8
regex==2023.10.3
requests-oauthlib==1.3.1
requests==2.31.0
rich==13.5.3
rich==13.6.0
six==1.16.0
sortedcontainers==2.4.0
text-unidecode==1.3
types-python-dateutil==2.8.19.14
typing-extensions==4.8.0
tzdata==2023.3
urllib3==2.0.5
urllib3==2.0.6
18 changes: 13 additions & 5 deletions {{cookiecutter.buildfolder}}/restore_datamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
import click
from utils import *

if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: ./restore_datamodel.py <dataset>")

@click.command()
@click.option("--drop", is_flag=True, default=False, help="Whether to drop data first.")
@click.option("--dry-run", is_flag=True, default=False, help="Whether to do a dry-run.")
@click.argument("folder")
def cli(dry_run: bool, drop: bool, folder: str):
load_datamodel_dump(ToolGlobals, drop=drop, dry_run=dry_run, directory=folder)
if ToolGlobals.failed:
print(f"Failure to load as expected.")
exit(1)

load_datamodel_dump(ToolGlobals)

if __name__ == "__main__":
cli()

0 comments on commit d74d021

Please sign in to comment.