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

refactor: move some hacks location #742

Merged

Conversation

chamini2
Copy link
Member

@chamini2 chamini2 commented Feb 3, 2023

FYI: the quoting was fixed in dbt for 1.4+ in dbt-labs/dbt-core#6620

@chamini2 chamini2 requested a review from mederka February 3, 2023 18:47
Copy link
Contributor

@drochetti drochetti left a comment

Choose a reason for hiding this comment

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

should we merge this before #739 ?

Comment on lines +97 to +105
def get_relation(self, database: str, schema: str, identifier: str):
# HACK: When compiling Python models, we get an all-False quoting policy
# This does not happen in 1.4
if self._db_adapter.type() == "athena":
# and dbt-athena-community breaks for that case
self.config.quoting = {"database": True, "schema": True, "identifier": True}

return self._db_adapter.get_relation(database, schema, identifier)

Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: Does it matter if we put it in a wrapper or in impl.py? I think impl.py is better because it's more visible there. This feels more like putting something under a rug.

Copy link
Member Author

Choose a reason for hiding this comment

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

The way I saw this change was taking it from the "general" soluton of the Adapter Mixin and putting it in the wrapper that is actually being used, since this is 1.3-specific and will not be replicated for 1.4

Copy link
Member Author

Choose a reason for hiding this comment

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

merging and you can make a decision in your PR

@mederka
Copy link
Collaborator

mederka commented Feb 6, 2023

should we merge this before #739 ?

Great suggestion, but this is not going into main. It's going to be released as a patch to 1.3.

@chamini2 chamini2 merged commit 52fbe81 into meder/fea-842/adapter-athena-support Feb 6, 2023
@chamini2 chamini2 deleted the matteo/fea-842-athena branch February 6, 2023 15:04
mederka added a commit that referenced this pull request Feb 6, 2023
* tests(dbt-fal): add athena profile

* feat: add dbt-athena-community support

dbt-athena from PyPI doesn't support dbt 1.3, but dbt-athena-community does
https://github.com/dbt-athena/dbt-athena

dbt-athena-community does not support dbt 1.4, so this branch doesn't need to
be merged to main. Instead, we will release a patch to dbt-fal 1.3 in order to
add support to dbt-athena-community

* PR comments

* refactor: move some hacks location (#742)

---------

Co-authored-by: Matteo Ferrando <[email protected]>
chamini2 added a commit that referenced this pull request Feb 9, 2023
* tests(dbt-fal): add athena profile

* feat: add dbt-athena-community support

dbt-athena from PyPI doesn't support dbt 1.3, but dbt-athena-community does
https://github.com/dbt-athena/dbt-athena

dbt-athena-community does not support dbt 1.4, so this branch doesn't need to
be merged to main. Instead, we will release a patch to dbt-fal 1.3 in order to
add support to dbt-athena-community

* PR comments

* refactor: move some hacks location (#742)

---------

Co-authored-by: Matteo Ferrando <[email protected]>
chamini2 added a commit that referenced this pull request Feb 10, 2023
* tests(dbt-fal): add athena profile

* feat: add dbt-athena-community support

dbt-athena from PyPI doesn't support dbt 1.3, but dbt-athena-community does
https://github.com/dbt-athena/dbt-athena

dbt-athena-community does not support dbt 1.4, so this branch doesn't need to
be merged to main. Instead, we will release a patch to dbt-fal 1.3 in order to
add support to dbt-athena-community

* PR comments

* refactor: move some hacks location (#742)

---------

Co-authored-by: Matteo Ferrando <[email protected]>
chamini2 added a commit that referenced this pull request Feb 10, 2023
* tests(dbt-fal): add athena profile

* feat: add dbt-athena-community support

dbt-athena from PyPI doesn't support dbt 1.3, but dbt-athena-community does
https://github.com/dbt-athena/dbt-athena

dbt-athena-community does not support dbt 1.4, so this branch doesn't need to
be merged to main. Instead, we will release a patch to dbt-fal 1.3 in order to
add support to dbt-athena-community

* PR comments

* refactor: move some hacks location (#742)

---------

Co-authored-by: Matteo Ferrando <[email protected]>
mederka added a commit that referenced this pull request Apr 4, 2023
* tests(dbt-fal): add athena profile

* feat: add dbt-athena-community support

dbt-athena from PyPI doesn't support dbt 1.3, but dbt-athena-community does
https://github.com/dbt-athena/dbt-athena

dbt-athena-community does not support dbt 1.4, so this branch doesn't need to
be merged to main. Instead, we will release a patch to dbt-fal 1.3 in order to
add support to dbt-athena-community

* PR comments

* refactor: move some hacks location (#742)

---------

Co-authored-by: Matteo Ferrando <[email protected]>
mederka added a commit that referenced this pull request Apr 4, 2023
* feat(dbt-adapter): dbt-athena-community support (#741)

* tests(dbt-fal): add athena profile

* feat: add dbt-athena-community support

dbt-athena from PyPI doesn't support dbt 1.3, but dbt-athena-community does
https://github.com/dbt-athena/dbt-athena

dbt-athena-community does not support dbt 1.4, so this branch doesn't need to
be merged to main. Instead, we will release a patch to dbt-fal 1.3 in order to
add support to dbt-athena-community

* PR comments

* refactor: move some hacks location (#742)

---------

Co-authored-by: Matteo Ferrando <[email protected]>

* remove 1.3-specific hack

* Add tests

* comments

* Fix test setup

* update athena profile

* fix credential parsing in isolated envs

---------

Co-authored-by: Matteo Ferrando <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants