Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RELEASE] v0.1.2 #41

Merged
merged 29 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3749013
Merge pull request #33 from palmetto/main
jakeberesford-palmetto Dec 2, 2021
8564311
Add test job to pull request workflow
jakeberesford-palmetto Dec 2, 2021
1795fd0
Use the matrix key here?
jakeberesford-palmetto Dec 2, 2021
7babf8b
Use dev requirements to make sure we have the deps we need in CI
jakeberesford-palmetto Dec 2, 2021
dcfeb1c
Fix import for mock
jakeberesford-palmetto Dec 2, 2021
09f5941
Try relative import here
jakeberesford-palmetto Dec 2, 2021
ce81f5b
add palm-dbt version for debugging purposes
emekdahl-palmetto Dec 2, 2021
d84ee35
Add conftest
jakeberesford-palmetto Dec 2, 2021
9df96db
Revert relative import, that is not the fix we need...
jakeberesford-palmetto Dec 2, 2021
bdc9d23
Install the package in CI to make testing work? Seems wrong, but will…
jakeberesford-palmetto Dec 2, 2021
3c4a25c
document how to check plugin version
emekdahl-palmetto Dec 2, 2021
4d66ee5
Better way to use the python version
jakeberesford-palmetto Dec 2, 2021
aa7c198
un-walrused
ethanknox-palmetto Dec 2, 2021
2f74799
add version flag and explain version selection
emekdahl-palmetto Dec 2, 2021
0f21526
Merge pull request #36 from palmetto/feature/add-palm-dbt-version-to-…
jakeberesford-palmetto Dec 2, 2021
fc9a529
Merge branch 'develop' into docs/clarify-version-selection
emekdahl-palmetto Dec 2, 2021
2de347d
remove whitespace commits
emekdahl-palmetto Dec 2, 2021
f54eb90
Merge pull request #37 from ethanknox-palmetto/hotfix/bye-bye-walrus
ethanknox-palmetto Dec 2, 2021
4030a7d
Use a prompt to set the dbt version if it was not provided via the --…
jakeberesford-palmetto Dec 2, 2021
fe0eab1
Fix linting
jakeberesford-palmetto Dec 2, 2021
58144f4
Merge branch 'develop' into feature/test-in-ci
jakeberesford-palmetto Dec 2, 2021
1d57a35
Black can't make it's mind up.
jakeberesford-palmetto Dec 2, 2021
895dfb2
remove bad copy in dockerfile
ethanknox-palmetto Dec 2, 2021
db19cc2
Merge pull request #40 from ethanknox-palmetto/hotfix/remove-profiles…
ethanknox-palmetto Dec 2, 2021
a17f378
Merge pull request #39 from jakeberesford-palmetto/feature/containeri…
ethanknox-palmetto Dec 2, 2021
0457e67
Merge pull request #38 from palmetto/docs/clarify-version-selection
ethanknox-palmetto Dec 2, 2021
961ce15
Merge pull request #35 from palmetto/feature/test-in-ci
ethanknox-palmetto Dec 2, 2021
b6b1557
bump version
emekdahl-palmetto Dec 3, 2021
67c4aaf
update changelog
emekdahl-palmetto Dec 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/01_bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Describe your issue here.

### Your environment
* Version of palm
* Version of palm-dbt (run `palm plugin versions` in your dbt project)
* Operating system
* Docker / Docker compose version
* Relevant dependencies and versions
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ on:
- develop

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
steps:
- uses: actions/checkout@v2
- name: Install Python 3
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install
run: |
pip install -r dev-requirements.txt
python3 -m pip install .
- name: PyTest
run: pytest
lint:
runs-on: ubuntu-latest
steps:
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Palm dbt Changelog

## 0.1.2
Features:
- **Containerize**: There is an explicit prompt to enter the dbt version number when containerizing a dbt project. Issue #34

Improvements:
- **Bug Fixes**: Removed profiles.yml reference in Dockerfile template. Palm-dbt detects profiles.yml automatically.
- **General**: Improved testing, documentation, CI, issue templates, and linting.


## 0.1.1

> 12/02/2021
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ plugins:
## Palm-ing an existing dbt project
palm-dbt ships with a command to containerize and convert your existing dbt project.

For example, if you wanted to containerize your existing dbt project running on 0.21.0, you would run:
```
palm containerize
palm containerize --version 0.21.0
```

Follow the prompts to select a dbt version and you will be ready to use this package.
## Check dbt plugin version

Check the version of palm-dbt inside a project in which you have configured palm with the dbt plugin:
`palm plugin versions`

### Adding palm dbt macros

Expand Down
3 changes: 3 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r palm/plugins/dbt/requirements.txt
pytest >= 6.2, < 6.3
black >= 19.10b0, < 20.0
9 changes: 6 additions & 3 deletions palm/plugins/dbt/commands/cmd_containerize.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from typing import Optional
import click
from pathlib import Path
from palm.plugins.dbt.dbt_containerizer import DbtContainerizer
Expand All @@ -7,11 +8,13 @@
@click.option(
"--version",
multiple=False,
default="0.21.0",
help="dbt version to use (default 0.21.0)",
help="dbt version to use (e.g. 0.21.0)",
)
@click.pass_context
def cli(ctx, version: str):
def cli(ctx, version: Optional[str]):
if not version:
version = click.prompt("Enter dbt version to use", type=str, default="0.21.0")

template_dir = Path(Path(__file__).parents[1], "templates") / "containerize"
DbtContainerizer(ctx, template_dir, version).run()
click.secho(f"Containerized {ctx.obj.palm.image_name}", fg="green")
3 changes: 2 additions & 1 deletion palm/plugins/dbt/dbt_containerizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ def determine_profile_strategy(cls, project_path: "Path") -> Tuple[str, str]:
the host and container volume mount values
"""
container_default = "/root/.dbt"
if profile_path := os.getenv("DBT_PROFILES_DIR"):
profile_path = os.getenv("DBT_PROFILES_DIR", None)
if profile_path:
profiles_dir = Path(profile_path)
if not profiles_dir.exists():
raise AbortPalm("Your host has a non-existant DBT_PROFILES_DIR value!")
Expand Down
1 change: 0 additions & 1 deletion palm/plugins/dbt/templates/containerize/Dockerfile.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM fishtownanalytics/dbt:{{dbt_version}}
COPY profiles.yml /root/.dbt/
COPY . /app/
WORKDIR /app
ENV PYTHONPATH=${PYTHONPATH}:${PWD}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

setup(
name='palm-dbt',
version='0.1.1',
version='0.1.2',
description='dbt extension for Palm CLI',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down
Empty file added tests/conftest.py
Empty file.
2 changes: 1 addition & 1 deletion tests/unit/test_dbt_containerizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import pytest
import mock
from unittest import mock
from pathlib import Path
from palm.plugins.dbt.dbt_containerizer import DbtContainerizer
from palm.environment import Environment
Expand Down