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

postgres relations add foreign_tables #6950

Closed
wants to merge 3 commits into from
Closed

Conversation

lialzm
Copy link

@lialzm lialzm commented Feb 11, 2023

resolves dbt-labs/dbt-postgres#53

When using incremental mode, if it is a remote table, data cannot be inserted

@lialzm lialzm requested a review from a team as a code owner February 11, 2023 02:37
@cla-bot
Copy link

cla-bot bot commented Feb 11, 2023

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, please reach out through a comment on this PR.

CLA has not been signed by users: @lialzm

@jtcohen6 jtcohen6 added the Team:Adapters Issues designated for the adapter area of the code label Feb 14, 2023
@github-actions
Copy link
Contributor

This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Aug 14, 2023
@lialzm
Copy link
Author

lialzm commented Aug 15, 2023

I submitted the cla agreement, but there seems to be no feedback

@github-actions github-actions bot removed the stale Issues that have gone stale label Aug 16, 2023
@graciegoheen
Copy link
Contributor

Thanks for opening this PR @lialzm ! Sorry for the delay here, I see this PR is missing an associated issue - that's typically where we give product/dx feedback.

Could you do the following?

  1. Open an associated issue (so there is a more detailed description of the problem, including a simple code example, that we can link to it in the changelog).
  2. Add a changelog entry

@colin-rogers-dbt colin-rogers-dbt added test postgres Run integration tests for the Postgres adapter in CI. ok_to_test labels Oct 10, 2023
@github-actions
Copy link
Contributor

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.

1 similar comment
@github-actions
Copy link
Contributor

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.

@dbeatty10
Copy link
Contributor

This looks like it would resolve dbt-labs/dbt-postgres#53, and I've added resolves dbt-labs/dbt-postgres#53 to the PR description to link it to that issue.

@lialzm

1. is taken care of -- no need to create a new issue.

You'd still need to do:

2. create a changelog entry (via changie new).

Comment on lines +74 to +80
select
'{{ schema_relation.database }}' as database,
foreign_table_name as name,
foreign_table_schema as schema,
'table' as type
from information_schema.foreign_tables
where foreign_table_schema ilike '{{ schema_relation.schema }}'
Copy link
Contributor

Choose a reason for hiding this comment

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

@lialzm could you take a look at the prototype version of this macro here?

Key thing

The key thing is that it uses external as the type rather than table. I don't know for certain, but I'm guessing that we'll want to to be external.

i.e., we want it to be the same as dbt_utils.get_table_types_sql here.

Something else to consider

I don't have strong opinions on using the information_schema.foreign_tables view versus the information_schema.tables view. Using information_schema.foreign_tables is a little more simple since it doesn't need an extra filter in the where clause.

@dbeatty10
Copy link
Contributor

@cla-bot check

@cla-bot cla-bot bot added the cla:yes label Nov 17, 2023
Copy link

cla-bot bot commented Nov 17, 2023

The cla-bot has been summoned, and re-checked this pull request!

@dbeatty10 dbeatty10 requested a review from a team as a code owner November 17, 2023 18:40
@dbeatty10 dbeatty10 requested a review from gshank November 17, 2023 18:40
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@f1087e5). Click here to learn what that means.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    dbt-labs/dbt-core#6950   +/-   ##
=======================================
  Coverage        ?   86.59%           
=======================================
  Files           ?      179           
  Lines           ?    26564           
  Branches        ?        0           
=======================================
  Hits            ?    23004           
  Misses          ?     3560           
  Partials        ?        0           
Flag Coverage Δ
integration 83.46% <ø> (?)
unit 64.98% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbeatty10 dbeatty10 added the community This PR is from a community member label Mar 22, 2024
@dbeatty10 dbeatty10 added dbt-postgres Needs migration to dbt-postgres repo bug Something isn't working labels Apr 9, 2024
@dbeatty10
Copy link
Contributor

Thanks for taking the time to open this PR @lialzm! Since opening, we've decoupled dbt Adapters from dbt Core, and this code now lives in a separate repo: dbt-postgres.

A consequence of the decoupling is that PR can't be merged anymore as is, so we're closing it. For more context see #9171.

The linked issue has already been transferred. Please don't hesitate to re-open your proposed code changes within this PR in the dbt-postgres repo.

@dbeatty10 dbeatty10 closed this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla:yes community This PR is from a community member dbt-postgres Needs migration to dbt-postgres repo ok_to_test Team:Adapters Issues designated for the adapter area of the code test postgres Run integration tests for the Postgres adapter in CI.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] adapter.get_relation returns None for Foreign Table Type
5 participants