You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2020. It is now read-only.
-`--log-level | -l`: choose program's logging level, from CRITICAL, ERROR, WARNING, INFO, DEBUG; default is INFO.
16
16
-`db-connection-string`: a [PostgreSQL Db Connection String](http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#module-sqlalchemy.dialects.postgresql.psycopg2) of the format `postgresql+psycopg2://user:password@host:port/dbname`
17
17
-`command` is the function to be performed by the utility. The currently supported values are:
18
-
-`init-execution`: Marks the start of a new execution by creating a record for the same in the given database. Returns an `execution-id` which is a GUID identifier of the new execution.
19
-
-`get-last-successful-execution`: Finds the last successful data pipeline execution. Returns an `execution-id` which is a GUID identifier of the new execution, if found; else returns and empty string.
20
-
-`get-execution-last-updated-timestamp`: Returns the `last-updated-on` timestamp with timezone of the given `execution-id`. Raises error if given `execution-id` is invalid.
21
-
-`execution-id`: a GUID identifier of an existing data pipeline execution.
22
-
-`persist-models`: Saves models of the given `model-type` within the given `execution-id` by persisting hashed checksums of the given models.
18
+
-`init-execution`: Marks the start of a new execution. Returns an `execution-id` which is a GUID identifier of the new execution.
19
+
-`get-last-successful-execution`: Finds the last successful execution. Returns an `execution-id` which is a GUID identifier of the new execution, if found; else returns and empty string.
20
+
-`get-execution-completion-timestamp`: Returns the `last-updated-on` timestamp with timezone of the given `execution-id`. Raises error if given `execution-id` is invalid.
21
+
-`execution-id`: a GUID identifier of an existing execution.
22
+
-`init-step`: Saves models of the given `model-type` within the given `execution-id` by persisting hashed checksums of the given models.
23
23
-`execution-id`: identifier of an existing data pipeline execution, ideally as returned by the `init` command.
24
-
-`model-type`: type of models being processed, choose from `LOAD`, `TRANSFORM`.
24
+
-`step-name`: name of step being processed, choose from `LOAD`, `TRANSFORM`.
25
25
-`base-path`: absolute or relative path to the models e.g.: `./load`, `/home/local/transform`, `C:/path/to/models`
26
26
-`model-patterns`: one or more unix-style search patterns _(relative to `base-path`)_ for model files. models within a model-type must be named uniquely regardless of their file extension. e.g.: `*.txt`, `**/*.txt`, `./relative/path/to/some_models/**/*.csv`, `relative/path/to/some/more/related/models/**/*.sql`
27
-
-`compare-models`: Compares the hashed checksums of models between two executions. Returns comma-separated string of changed model names.
28
-
-`previous-execution-id`: identifier of an existing data pipeline execution, ideally as returned by the `get-last-successful-execution` command.
29
-
-`current-execution-id`: identifier of an existing data pipeline execution, ideally as returned by the `init` command.
30
-
-`model-type`: type of models being processed, choose from `LOAD`, `TRANSFORM`.
31
-
-`complete-execution`: Marks the completion of an existing execution by updating a record for the same in the given database. Returns nothing unless there's an error.
32
-
-`execution-id`: a GUID identifier of an existing data pipeline execution as returned by the `init` command.
27
+
-`compare-step-models`: Compares the hashed checksums of models between two executions' steps. Returns comma-separated string of changed model names.
28
+
-`step-id`: identifier of an existing execution's step, as returned by the `init-step` command.
29
+
-`previous-execution-id`: identifier of an existing execution, ideally as returned by the `get-last-successful-execution` command.
30
+
-`complete-step`: Marks the completion of an existing execution's step. Returns nothing unless there's an error.
31
+
-`step-id`: a GUID identifier of an existing execution's step as returned by the `init-step` command.
32
+
-`rows-processed`: an optional numeric value to indicate the number of rows processed during this step. supports a postgresql BIGINT type value.
33
+
-`complete-execution`: Marks the completion of an existing execution. Returns nothing unless there's an error.
34
+
-`execution-id`: a GUID identifier of an existing execution as returned by the `init-execution` command.
33
35
34
36
To get help, use:
35
37
@@ -110,7 +112,7 @@ $ pytest
110
112
111
113
Before running integration tests, please ensure the following information is configured correctly:
112
114
113
-
-`tests/integration/test_integration.sh:7`
115
+
-`tests/integration/test_integration.sh:8`
114
116
115
117
Please ensure that the database connection string points to a valid PostgreSQL instance with valid parameters.
116
118
@@ -147,3 +149,74 @@ If you do not have `make` installed, you can substitute `make` with:
147
149
```
148
150
$ ./tests/integration/test_integration.sh
149
151
```
152
+
153
+
## Alembic
154
+
155
+
### To upgrade to the latest schema
156
+
157
+
```bash
158
+
alembic -c dpo/alembic.ini -x $DESTINATION_DB_URL upgrade head
159
+
```
160
+
161
+
### Updating the schema
162
+
163
+
Ensure any new tables inherit from the same Base used in `alembic/env.py`
Also try importing the models into `alembic/env.py`, eg
208
+
209
+
```python
210
+
from dpo.entities import ModelChecksumEntity
211
+
from dpo.entities import DataPipelineExecutionEntity
212
+
```
213
+
214
+
### Alembic won't pick up my change
215
+
216
+
[Alembic only supports some changes](https://alembic.sqlalchemy.org/en/latest/autogenerate.html#what-does-autogenerate-detect-and-what-does-it-not-detect)
217
+
218
+
Try adding raw sql in the `upgrade()` and `downgrade()` functions of your revision
0 commit comments