joaoxg commited on
Commit
e8059bf
1 Parent(s): 7cb4d48

add remaining DagsHub/Cookiecutter-MLOps repo content

Browse files
.dvc/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ /config.local
2
+ /tmp
3
+ /cache
.dvc/config ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ['remote "origin"']
2
+ url = https://dagshub.com/DagsHub/Cookiecutter-MLOps.dvc
.dvcignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Add patterns of files dvc should ignore, which could improve
2
+ # the performance. Learn more at
3
+ # https://dvc.org/doc/user-guide/dvcignore
.gitignore ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+
5
+ # C extensions
6
+ *.so
7
+
8
+ # Distribution / packaging
9
+ .Python
10
+ /env/
11
+ /build/
12
+ /develop-eggs/
13
+ /dist/
14
+ /downloads/
15
+ /eggs/
16
+ /.eggs/
17
+ /lib/
18
+ /lib64/
19
+ /parts/
20
+ /sdist/
21
+ /var/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+
26
+ # PyInstaller
27
+ # Usually these files are written by a python script from a template
28
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
29
+ *.manifest
30
+ *.spec
31
+
32
+ # Installer logs
33
+ pip-log.txt
34
+ pip-delete-this-directory.txt
35
+
36
+ # Unit test / coverage reports
37
+ htmlcov/
38
+ .tox/
39
+ .coverage
40
+ .coverage.*
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+ *.cover
45
+
46
+ # Translations
47
+ *.mo
48
+ *.pot
49
+
50
+ # Django stuff:
51
+ *.log
52
+
53
+ # Sphinx documentation
54
+ /docs/_build/
55
+
56
+ # PyBuilder
57
+ /target/
58
+
59
+ # DotEnv configuration
60
+ .env
61
+
62
+ # Database
63
+ *.db
64
+ *.rdb
65
+
66
+ # Pycharm
67
+ .idea
68
+
69
+ # VS Code
70
+ .vscode/
71
+
72
+ # Spyder
73
+ .spyproject/
74
+
75
+ # Jupyter NB Checkpoints
76
+ .ipynb_checkpoints/
77
+
78
+ # exclude data, trained models, and related utils from source control by default
79
+ /models
80
+
81
+ # Mac OS-specific storage files
82
+ .DS_Store
83
+
84
+ # vim
85
+ *.swp
86
+ *.swo
87
+
88
+ # Mypy cache
89
+ .mypy_cache/
90
+
91
+ #Virtual Environment
92
+ jointvenv/
.pre-commit-config.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ repos:
2
+ - repo: https://github.com/nbQA-dev/nbQA
3
+ rev: 1.5.3
4
+ hooks:
5
+ - id: nbqa-black
6
+ - id: nbqa-pyupgrade
7
+ - id: nbqa-isort
8
+ - repo: https://github.com/timothycrosley/isort
9
+ rev: 5.10.1
10
+ hooks:
11
+ - id: isort
12
+ args: [ --profile, black ]
13
+ - repo: https://github.com/psf/black
14
+ rev: 22.10.0
15
+ hooks:
16
+ - id: black
17
+ - repo: https://github.com/pre-commit/mirrors-mypy
18
+ rev: v0.991
19
+ hooks:
20
+ - id: mypy
21
+ args: [ --ignore-missing-imports, --pretty, --show-error-codes ]
22
+ - repo: https://github.com/asottile/pyupgrade
23
+ rev: v3.3.0
24
+ hooks:
25
+ - id: pyupgrade
26
+ - repo: https://github.com/pre-commit/pre-commit-hooks
27
+ rev: v4.3.0
28
+ hooks:
29
+ - id: check-ast
30
+ - id: check-case-conflict
31
+ - id: check-docstring-first
32
+ - id: check-json
33
+ - id: check-merge-conflict
34
+ - id: debug-statements
35
+ - id: check-symlinks
36
+ - id: check-yaml
37
+ args: [ --unsafe, --allow-multiple-documents ]
38
+ - id: detect-private-key
39
+ - id: end-of-file-fixer
40
+ - id: requirements-txt-fixer
41
+ - id: trailing-whitespace
42
+ args: [ --markdown-linebreak-ext=md ]
LICENSE ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
5
+
6
+ 1. Definitions.
7
+
8
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
9
+
10
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
11
+
12
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
13
+
14
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
15
+
16
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
17
+
18
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
19
+
20
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
21
+
22
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
23
+
24
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
25
+
26
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
27
+
28
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
29
+
30
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
31
+
32
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
33
+
34
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
35
+
36
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
37
+
38
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
39
+
40
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
41
+
42
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
43
+
44
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
45
+
46
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
47
+
48
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
49
+
50
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
51
+
52
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
53
+
54
+ END OF TERMS AND CONDITIONS
55
+
56
+ APPENDIX: How to apply the Apache License to your work.
57
+
58
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
59
+
60
+ Copyright [yyyy] [name of copyright owner]
61
+
62
+ Licensed under the Apache License, Version 2.0 (the "License");
63
+ you may not use this file except in compliance with the License.
64
+ You may obtain a copy of the License at
65
+
66
+ http://www.apache.org/licenses/LICENSE-2.0
67
+
68
+ Unless required by applicable law or agreed to in writing, software
69
+ distributed under the License is distributed on an "AS IS" BASIS,
70
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71
+ See the License for the specific language governing permissions and
72
+ limitations under the License.
Makefile ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .PHONY: clean dirs virtualenv lint requirements push pull reproduce
2
+
3
+ #################################################################################
4
+ # GLOBALS #
5
+ #################################################################################
6
+
7
+ PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
8
+ PYTHON_INTERPRETER = python3
9
+
10
+ #################################################################################
11
+ # COMMANDS #
12
+ #################################################################################
13
+
14
+ ## Create virtualenv.
15
+ ## Activate with the command:
16
+ ## source env/bin/activate
17
+ virtualenv:
18
+ $(PYTHON_INTERPRETER) -m venv env
19
+ $(info "Activate with the command 'source env/bin/activate'")
20
+
21
+ ## Install Python Dependencies.
22
+ ## Make sure you activate the virtualenv first!
23
+ requirements:
24
+ $(PYTHON_INTERPRETER) -m pip install -U pip setuptools wheel
25
+ $(PYTHON_INTERPRETER) -m pip install -r requirements.txt
26
+
27
+ ## Create directories that are ignored by git but required for the project
28
+ dirs:
29
+ mkdir -p data/raw data/processed models
30
+
31
+ ## Delete all compiled Python files
32
+ clean:
33
+ find . -type f -name "*.py[co]" -delete
34
+ find . -type d -name "__pycache__" -delete
35
+
36
+ ## To use the pre-commit hooks
37
+ pre-commit-install:
38
+ pre-commit install
39
+
40
+ setup-data-validation:
41
+ cd src/data; great_expectations -y init; great_expectations datasource new
42
+
43
+ run-data-validation:
44
+ cd src/data; python data_validation.py
45
+
46
+ ## Lint using flake8
47
+ lint:
48
+ flake8 src
49
+
50
+ ## Upload Data to default DVC remote
51
+ push:
52
+ dvc push -r origin
53
+
54
+ ## Download Data from default DVC remote
55
+ pull:
56
+ dvc pull -r origin
57
+
58
+ ## Reproduce the DVC pipeline - recompute any modified outputs such as processed data or trained models
59
+ reproduce:
60
+ dvc repro
61
+
62
+ #################################################################################
63
+ # PROJECT RULES #
64
+ #################################################################################
65
+
66
+
67
+
68
+ #################################################################################
69
+ # Self Documenting Commands #
70
+ #################################################################################
71
+
72
+ .DEFAULT_GOAL := reproduce
73
+
74
+ # Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
75
+ # sed script explained:
76
+ # /^##/:
77
+ # * save line in hold space
78
+ # * purge line
79
+ # * Loop:
80
+ # * append newline + line to hold space
81
+ # * go to next line
82
+ # * if line starts with doc comment, strip comment character off and loop
83
+ # * remove target prerequisites
84
+ # * append hold space (+ newline) to line
85
+ # * replace newline plus comments by `---`
86
+ # * print line
87
+ # Separate expressions are necessary because labels cannot be delimited by
88
+ # semicolon; see <http://stackoverflow.com/a/11799865/1968>
89
+ .PHONY: help
90
+ help:
91
+ @echo "$$(tput bold)Available rules:$$(tput sgr0)"
92
+ @echo
93
+ @sed -n -e "/^## / Missing" $Missing \
94
+ | LC_ALL='C' sort --ignore-case \
95
+ | awk -F '---' \
96
+ -v ncol=$$(tput cols) \
97
+ -v indent=19 \
98
+ -v col_on="$$(tput setaf 6)" \
99
+ -v col_off="$$(tput sgr0)" \
100
+ 'Missing \
101
+ printf "%s ", words[i]; \
102
+ } \
103
+ printf "\n"; \
104
+ }' \
105
+ | more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
data/.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ /raw
2
+ /processed
data/raw.dvc ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ outs:
2
+ - md5: d751713988987e9331980363e24189ce.dir
3
+ size: 0
4
+ nfiles: 0
5
+ path: raw
dvc.lock ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema: '2.0'
2
+ stages:
3
+ train:
4
+ cmd: python -m src.models.train_model
5
+ deps:
6
+ - path: data/processed
7
+ md5: d751713988987e9331980363e24189ce.dir
8
+ size: 0
9
+ nfiles: 0
10
+ - path: src/models/train_model.py
11
+ md5: d41d8cd98f00b204e9800998ecf8427e
12
+ size: 0
13
+ outs:
14
+ - path: models
15
+ md5: d751713988987e9331980363e24189ce.dir
16
+ size: 0
17
+ nfiles: 0
18
+ - path: reports/training_metrics.csv
19
+ md5: d41d8cd98f00b204e9800998ecf8427e
20
+ size: 0
21
+ eval:
22
+ cmd: python -m src.models.predict_model
23
+ deps:
24
+ - path: data/processed
25
+ md5: d751713988987e9331980363e24189ce.dir
26
+ size: 0
27
+ nfiles: 0
28
+ - path: models
29
+ md5: d751713988987e9331980363e24189ce.dir
30
+ size: 0
31
+ nfiles: 0
32
+ - path: src/models/predict_model.py
33
+ md5: d41d8cd98f00b204e9800998ecf8427e
34
+ size: 0
35
+ outs:
36
+ - path: reports/metrics.csv
37
+ md5: d41d8cd98f00b204e9800998ecf8427e
38
+ size: 0
39
+ process_data:
40
+ cmd: python -m src.data.make_dataset
41
+ deps:
42
+ - path: data/raw
43
+ md5: d751713988987e9331980363e24189ce.dir
44
+ size: 0
45
+ nfiles: 0
46
+ - path: src/data/make_dataset.py
47
+ md5: d41d8cd98f00b204e9800998ecf8427e
48
+ size: 0
49
+ outs:
50
+ - path: data/processed
51
+ md5: d751713988987e9331980363e24189ce.dir
52
+ size: 0
53
+ nfiles: 0
dvc.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ stages:
2
+ train:
3
+ cmd: python -m src.models.train_model
4
+ deps:
5
+ - data/processed
6
+ - src/models/train_model.py
7
+ outs:
8
+ - models:
9
+ persist: true
10
+ metrics:
11
+ - reports/training_metrics.csv:
12
+ cache: false
13
+ eval:
14
+ cmd: python -m src.models.predict_model
15
+ deps:
16
+ - data/processed
17
+ - models
18
+ - src/models/predict_model.py
19
+ metrics:
20
+ - reports/metrics.csv:
21
+ cache: false
22
+ process_data:
23
+ cmd: python -m src.data.make_dataset
24
+ deps:
25
+ - data/raw
26
+ - src/data/make_dataset.py
27
+ outs:
28
+ - data/processed:
29
+ persist: true
notebooks/.gitkeep ADDED
File without changes
references/.gitkeep ADDED
File without changes
reports/.gitkeep ADDED
File without changes
reports/figures/.gitkeep ADDED
File without changes
reports/metrics.csv ADDED
File without changes
reports/training_metrics.csv ADDED
File without changes
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ # external requirements
2
+ dvc==2.26.2
3
+ pre-commit==2.20.0
4
+ great_expectations==0.15.23
setup.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from setuptools import find_packages, setup
2
+
3
+ setup(
4
+ name="src",
5
+ packages=find_packages(),
6
+ version="0.1.0",
7
+ )
src/__init__.py ADDED
File without changes
src/data/.gitkeep ADDED
File without changes
src/data/__init__.py ADDED
File without changes
src/data/data_validation.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import great_expectations as ge
2
+ from great_expectations.core.batch import BatchRequest
3
+ from great_expectations.checkpoint import SimpleCheckpoint
4
+ from great_expectations.exceptions import DataContextError
5
+
6
+ """
7
+ **IMPORTANT**
8
+ This file is meant to be run as an end-2-end test command.
9
+ It is an example and might require changes to suit your data and use case.
10
+
11
+ Please refer to the `example-project` branch of the Cookiecutter-MLOps project for a complete working example –
12
+ https://dagshub.com/DagsHub/Cookiecutter-MLOps/src/example-project
13
+ """
14
+
15
+ context = ge.data_context.DataContext()
16
+
17
+ batch_request = {
18
+ "datasource_name": "{{fill in datasource name}}",
19
+ "data_connector_name": "default_inferred_data_connector_name",
20
+ "data_asset_name": "{{fill in names of files that have tests}}", # Define the data files that should be tested
21
+ "limit": 1000,
22
+ }
23
+
24
+ # Feel free to change the name of your suite here. Renaming this will not remove the other one.
25
+ expectation_suite_name = "{{fill in your test suite name}}"
26
+ try:
27
+ suite = context.get_expectation_suite(expectation_suite_name=expectation_suite_name)
28
+ print(
29
+ f'Loaded ExpectationSuite "{suite.expectation_suite_name}" containing {len(suite.expectations)} expectations'
30
+ )
31
+ except DataContextError:
32
+ suite = context.create_expectation_suite(
33
+ expectation_suite_name=expectation_suite_name
34
+ )
35
+ print(f'Created ExpectationSuite "{suite.expectation_suite_name}".')
36
+
37
+ validator = context.get_validator(
38
+ batch_request=BatchRequest(**batch_request),
39
+ expectation_suite_name=expectation_suite_name,
40
+ )
41
+
42
+ checkpoint_config = {
43
+ "class_name": "SimpleCheckpoint",
44
+ "validations": [
45
+ {
46
+ "batch_request": batch_request,
47
+ "expectation_suite_name": expectation_suite_name,
48
+ }
49
+ ],
50
+ }
51
+ checkpoint = SimpleCheckpoint(
52
+ f"{validator.active_batch_definition.data_asset_name}_{expectation_suite_name}",
53
+ context,
54
+ **checkpoint_config,
55
+ )
56
+ checkpoint_result = checkpoint.run()
57
+
58
+ context.build_data_docs()
59
+
60
+ validation_result_identifier = checkpoint_result.list_validation_result_identifiers()[0]
61
+ context.open_data_docs(resource_identifier=validation_result_identifier)
src/data/great_expectations/.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ uncommitted/
src/data/make_dataset.py ADDED
File without changes
src/models/.gitkeep ADDED
File without changes
src/models/__init__.py ADDED
File without changes
src/models/predict_model.py ADDED
File without changes
src/models/train_model.py ADDED
File without changes
src/visualization/.gitkeep ADDED
File without changes
src/visualization/__init__.py ADDED
File without changes
src/visualization/visualize.py ADDED
File without changes