-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from runprism/docs-update
Update and prettify documentation
- Loading branch information
Showing
23 changed files
with
397 additions
and
17 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 was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
43 changes: 43 additions & 0 deletions
43
prism/tests/integration/test_projects/010a_multiple_nested_dirs/dev/dev.ipynb
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,43 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"id": "7eafd19a", | ||
"metadata": {}, | ||
"source": [ | ||
"**Use this notebook for developing code before productionizing it within tasks**" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "b771bf53", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"## CODE HERE..." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.7.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
1 change: 1 addition & 0 deletions
1
prism/tests/integration/test_projects/010a_multiple_nested_dirs/output/task01.txt
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 @@ | ||
Hello from task 1! |
2 changes: 2 additions & 0 deletions
2
prism/tests/integration/test_projects/010a_multiple_nested_dirs/output/task02.txt
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,2 @@ | ||
Hello from task 1! | ||
Hello from task 2! |
53 changes: 53 additions & 0 deletions
53
prism/tests/integration/test_projects/010a_multiple_nested_dirs/prism_project.py
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,53 @@ | ||
""" | ||
Prism project | ||
""" | ||
|
||
# Imports | ||
import logging | ||
from pathlib import Path | ||
from prism.admin import generate_run_id, generate_run_slug | ||
|
||
|
||
# Project metadata | ||
NAME = "" | ||
AUTHOR = "" | ||
VERSION = "" | ||
DESCRIPTION = """ | ||
""" | ||
|
||
# Admin | ||
RUN_ID = generate_run_id() # don't delete this! | ||
SLUG = generate_run_slug() # don't delete this! | ||
|
||
|
||
# sys.path config. This gives your tasks access to local tasks / packages that exist | ||
# outside of your project structure. | ||
SYS_PATH_CONF = [ | ||
Path(__file__).parent, | ||
Path(__file__).parent.parent, | ||
] | ||
|
||
|
||
# Thread count: number of workers to use to execute tasks concurrently. If set to 1, | ||
# then 1 task is run at a time. | ||
THREADS = 1 | ||
|
||
|
||
# Profile directory and name | ||
PROFILE_YML_PATH = Path(__file__).parent / 'profile.yml' | ||
PROFILE = None # name of profile within `profiles.yml` | ||
|
||
|
||
# Logger | ||
PRISM_LOGGER = logging.getLogger("PRISM_LOGGER") | ||
|
||
|
||
# Other variables / parameters. Make sure to capitalize all of these! | ||
VAR_1 = {'a': 'b'} | ||
VAR_2 = 200 | ||
VAR_3 = '2015-01-01' | ||
|
||
# Paths | ||
WKDIR = Path(__file__).parent | ||
DATA = WKDIR / 'data' | ||
OUTPUT = WKDIR / 'output' |
32 changes: 32 additions & 0 deletions
32
.../tests/integration/test_projects/010a_multiple_nested_dirs/tasks/extract/load/module03.py
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,32 @@ | ||
########### | ||
# Imports # | ||
########### | ||
|
||
# Prism infrastructure imports | ||
import prism.task | ||
import prism.target | ||
import prism.decorators | ||
|
||
|
||
#################### | ||
# Class definition # | ||
#################### | ||
|
||
class Task03(prism.task.PrismTask): | ||
|
||
# Run | ||
def run(self, tasks, hooks): | ||
""" | ||
Execute task. | ||
args: | ||
tasks: used to reference output of other tasks --> tasks.ref('...') | ||
hooks: built-in Prism hooks. These include: | ||
- hooks.dbt_ref --> for getting dbt tasks as a pandas DataFrame | ||
- hooks.sql --> for executing sql query using an adapter in profile YML | ||
- hooks.spark --> for accessing SparkSession | ||
returns: | ||
task output | ||
""" | ||
lines = tasks.ref('extract/module02.py') | ||
return lines + '\n' + 'Hello from task 3!' |
Oops, something went wrong.