Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Add unit test for filesystem service. #184

Merged
merged 48 commits into from
Mar 22, 2023
Merged

Add unit test for filesystem service. #184

merged 48 commits into from
Mar 22, 2023

Conversation

dichenqiandbt
Copy link
Contributor

What is this PR?

This is a:

  • documentation update
  • bug fix with no breaking changes
  • new functionality
  • a breaking change

All pull requests from community contributors should target the main branch (default).

Description & motivation

One find is that for async end point, as we change our working directory, the dbt log file is stored under dbt project instead of dbt server(I think it's not expected).

Checklist

  • I have verified that these changes work locally on the following warehouses (Note: it's okay if you do not have access to all warehouses, this helps us understand what has been covered)
    • BigQuery
    • Postgres
    • Redshift
    • Snowflake
    • Databricks
    • Spark
  • I have updated the README.md (if applicable)
  • I have added tests & descriptions to my models
  • I have added an entry to CHANGELOG.md

racheldaniel and others added 30 commits December 2, 2022 09:20
* Support partial parsing

* Updates todo
* possible way of intergrating all of the dbt commands

* somewhat working version of a generalized framework

* working version of run, a lot of refactor and better core interface needed

* using some new interface

* remove unused function

* using state for run task

* some clean up

* Resolves merge conflicts (#145)

* Core integration updates (#148)

* Updates state_id usage

* Moves task logic to StateController

* removes hardcoded command

* Initiates logmanager in async function

* Removes old async logic and reinstates python logger for dbt-server

Co-authored-by: Rachel <41338402+racheldaniel@users.noreply.github.com>
Co-authored-by: Rachel Daniel <rachel.daniel@fishtownanalytics.com>
…irements.txt to resolve error handling issue with underlying FastAPI dependency (#149)

* Upgrade FastAPI version in requirements.txt and add httpx to dev-requirements.txt to resolve error handling issue with underlying FastAPI dependency

* Add changelog entry
* possible way of intergrating all of the dbt commands

* somewhat working version of a generalized framework

* working version of run, a lot of refactor and better core interface needed

* using some new interface

* remove unused function

* using state for run task

* some clean up

* Core integration updates (#148)

* Updates state_id usage

* Moves task logic to StateController

* removes hardcoded command

* Removes old async logic and reinstates python logger for dbt-server

* Beginning logic to accept a project path

* Adds project_path storing and cacheing

* Removes prints and fixes caching issue

* removes unused task functions

* adds changie entry

* removes dup code from rebase error

* removes dup code from rebase error

* removes dup code from rebase error

* Adds tests for dbt_entry and preliminary state tests

* Removes unused file

* Copies minimal project to tempdir to avoid writing files

Co-authored-by: Chenyu Li <chenyu.li@dbtlabs.com>
Co-authored-by: Chenyu Li <chenyulee777@gmail.com>
* Updates async endpoint to use set_profile_name function

* Adds checkfirst flag to avoid table exists error

* Fixes profile name and potential fix for sqlalchemy error

* Adds profile back to command args

* Fixes whitespace

* Adds status endpoint
* Adds sync endpoint and fixes linting

* Adds test for sync dbt entry endpoint

* Fixes formatting

* Adds changie entry
* Add the requests library to the requirements

* Replace each specific task update method with a generic method so that it can be called cleanly upstream

* Update this class to use camel casing

* Add new update task status method that sets the task status in the local DB as well as calling the callback if there is one

* Accept a callback url and pass it to the async command method

* Call the new update task status method where the crud methods were previously called

* Move requests from the dev requirements to requirements

* Return the state ID in addition to the other task fields in the async response

* Remove commented out code

* Specify to retry post requests since it isn't enabled by default

* Update dbt_server/views.py

Co-authored-by: Rachel <41338402+racheldaniel@users.noreply.github.com>

* Rename DBTCommandArgs to DbtCommandArgs

* Add a change log entry

---------

Co-authored-by: Rachel <41338402+racheldaniel@users.noreply.github.com>
* Updates db path to working dir instead of app root

* Solidifies locations that the dbt-server writes to

* Changes back to app root after dbt command run

* Fixes comment
…creating the async task. If not present, create a task ID and use it (#168)
* Fix tests.

* Fix wrong package

* Remove adaptor requirements and skip tests without dependency.

* Fix wrong package name
* Resolves merge conflicts

* Cherry-pick gone awry

* spaces

* Allows images to build on PR
* Removes conditional on test, tailors to branch

* Adds changie entry

* Comments out unused matrix
@github-actions
Copy link

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

dichenqiandbt and others added 6 commits February 27, 2023 19:16
* Add smoke test and check in test dbt project jaffle shop.

* nits

* nits

* Add changie

* Update smoke test.

* Start dbt-server inside smoke test.

* Fix format.
Base automatically changed from feature/v0.2.0 to main February 28, 2023 20:17
Comment on lines +21 to +23
from os import makedirs
from os import environ
from os import path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own knowledge, is there a reason you choose to separate imports this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a pure code style decision and my reference is

I think the advantage to separate them out is it's the clearest and easiest understand way. Compare with
from xx import a, b, c(sometimes the import list is too long and hard to read) or from xx import (a,
b,
c
)(I feel like my eye needs to jump between lines).

That's definitely a code style thinking, I'm neutral on other solutions but lean to separate imports. Hope to align with you(then we can strictly following this later). Most of my python code style is the Google one, feel free to offline discuss with me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info! I've never seen it this way but don't have a preference. My only hesitation is that we may want to keep our style consistent with dbt-core for contribution reasons-- but I don't feel strongly about that either. Totally your call.

dichenqiandbt and others added 4 commits March 2, 2023 19:11
Co-authored-by: Rachel <41338402+racheldaniel@users.noreply.github.com>
Co-authored-by: Rachel <41338402+racheldaniel@users.noreply.github.com>
Co-authored-by: Rachel <41338402+racheldaniel@users.noreply.github.com>
Copy link
Contributor

@racheldaniel racheldaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you!

@dichenqiandbt dichenqiandbt merged commit 16b2cd9 into main Mar 22, 2023
@dichenqiandbt dichenqiandbt deleted the dichen/dev_2 branch March 22, 2023 19:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants