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

[Issue #3271] Setup structure of opportunity attachment transformation (minus file logic) #3443

Merged
merged 6 commits into from
Jan 15, 2025

Conversation

chouinar
Copy link
Collaborator

@chouinar chouinar commented Jan 7, 2025

Summary

Fixes #3271

Time to review: 10 mins

Changes proposed

Add a subtask to transform the opportunity attachment table

DOES NOT handle the files themselves (next PR will handle that)

Context for reviewers

The transformation code is bulky and has a lot of repeated patterns that needed to be setup. This PR gets all of that setup and working for the opportunity attachment table, except for the logic regarding moving the file from the staging table to our s3 bucket (which has a lot of extra fun complexities that will need to be handled special). Every other column in the table we want is copied over and functionally working with these changes.

The follow-up to this likely will refactor a bit to make the file logic reasonable, but figured it was best to start with a pattern that looks like the other transformations we've done.

Additional information

From a clean database, you can run this locally by doing make console and then using our factories to generate data

f.StagingTsynopsisAttachmentFactory.create_batch(size=50)
exit()

I then modified TransformOracleDataTask to only run the TransformOpportunity and new TransformOpportunityAttachment classes which successfully copied to my local opportunity_attachment table as expected:
Screenshot 2025-01-07 at 3 28 25 PM

@chouinar chouinar requested a review from mdragon as a code owner January 7, 2025 20:31
)


def test_uploading_attachment_staging(db_session, enable_factory_create, tmp_path):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because these tests use the staging table factories heavily, we don't need the specific tests anymore

@chouinar chouinar merged commit 412d01e into main Jan 15, 2025
2 checks passed
@chouinar chouinar deleted the chouinar/3271-attachment-transform branch January 15, 2025 19:00
Copy link
Collaborator

@babebe babebe left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setup the basic structure of the attachment transformation code
3 participants