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

#3682 Changed how tables and views are generated to be able to use differen… #3691

Merged
merged 4 commits into from
Sep 9, 2021
Merged

Conversation

AndreasTA-AW
Copy link
Contributor

@AndreasTA-AW AndreasTA-AW commented Aug 4, 2021

…t options

resolves #3682

Description

I added a new function called common where common options can be put, otherwise views and tables are separated from each other to be able to add either for both or a single one of them.

Not sure if it's good enough or what you say. I ran the tests but didn't touch them.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@cla-bot
Copy link

cla-bot bot commented Aug 4, 2021

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @AndreasTA-FF

@AndreasTA-AW
Copy link
Contributor Author

I'll ping here. Would be nice if someone looks at this. I will sign the agreement when we think this will eventually be merged :)

Copy link
Contributor

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

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

Thanks for this @AndreasTA-AW! The code looks good to me. Appreciate the ping, and sorry for the delay getting back to you.

As far as testing this change, I think a unit test in the style of these ones should be sufficient. How about something like:

    def test_table_kms_key_name(self):
        adapter = self.get_adapter('oauth')
        mock_config = create_autospec(
            RuntimeConfigObject)
        config={'kms_key_name': 'some_key'}
        mock_config.get.side_effect = lambda name: config.get(name)

        expected = {
            'kms_key_name': "'some_key'"
        }
        actual = adapter.get_table_options(mock_config, node={}, temporary=False)
        self.assertEqual(expected, actual)

        
    def test_view_kms_key_name(self):
        adapter = self.get_adapter('oauth')
        mock_config = create_autospec(
            RuntimeConfigObject)
        config={'kms_key_name': 'some_key'}
        mock_config.get.side_effect = lambda name: config.get(name)

        expected = {}
        actual = adapter.get_view_options(mock_config, node={})
        self.assertEqual(expected, actual)

After adding that test, could you:

  • Pull changes from develop
  • Add a changelog entry below ## dbt 0.21.0 (Release TBD)
  • Sign the CLA

@AndreasTA-AW
Copy link
Contributor Author

The tests looks great to me, I'll add those and make sure they pass. I'll then finish the rest of the tasks you added.

Thanks for looking in to it!

@cla-bot
Copy link

cla-bot bot commented Aug 31, 2021

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @AndreasTA-FF

2 similar comments
@cla-bot
Copy link

cla-bot bot commented Aug 31, 2021

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @AndreasTA-FF

@cla-bot
Copy link

cla-bot bot commented Aug 31, 2021

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, don't hesitate to ping @drewbanin.

CLA has not been signed by users: @AndreasTA-FF

@jtcohen6
Copy link
Contributor

jtcohen6 commented Sep 2, 2021

@AndreasTA-AW Will you be able to sign the CLA? The PR looks in good shape, so that's the only blocker to merging this in.

@AndreasTA-AW
Copy link
Contributor Author

Hi!
I'm actually waiting to get a GO on that, hopefully it will be solved anytime.

@cla-bot cla-bot bot added the cla:yes label Sep 9, 2021
@AndreasTA-AW
Copy link
Contributor Author

@jtcohen6 Sorry for the delay, I got an OK to sign it now, so it should all be fixed.

Copy link
Contributor

@jtcohen6 jtcohen6 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @AndreasTA-AW!

@jtcohen6 jtcohen6 merged commit 90e5507 into dbt-labs:develop Sep 9, 2021
TeddyCr pushed a commit to TeddyCr/dbt that referenced this pull request Sep 9, 2021
…o use differen… (dbt-labs#3691)

* Changed how tables and views are generated to be able to use different options

* 3682 added unit tests

* 3682 had conflict in changelog and became a bit messy

* 3682 Tested to add default kms to dataset and accidently pushed the changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQuery KMS should not be used on VIEWS
3 participants