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

Set asset pricing data column to null on updates from flow grpc #562

Merged

Conversation

nullpointer0x00
Copy link
Contributor

@nullpointer0x00 nullpointer0x00 commented Oct 18, 2024

Description

This PR modifies the asset pricing update logic by ensuring the data column is set to null on update or insert. Previously, the data column contained the json response from the figure pricing service, which is no longer necessary since data now comes from the Flow API. By nullifying the data column, we remove this outdate content.

This column will be removed completely in the future: #563

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@nullpointer0x00 nullpointer0x00 self-assigned this Oct 18, 2024
@nullpointer0x00 nullpointer0x00 marked this pull request as ready for review October 18, 2024 15:07
@nullpointer0x00 nullpointer0x00 requested a review from a team as a code owner October 18, 2024 15:07
@nullpointer0x00 nullpointer0x00 enabled auto-merge (squash) October 18, 2024 15:13
@@ -219,7 +219,7 @@ object AssetPricingTable : IdTable<Int>(name = "asset_pricing") {
val pricing = decimal("pricing", 100, 50)
val pricingDenom = varchar("pricing_denom", 256)
val lastUpdated = datetime("last_updated")
val data = jsonb<AssetPricingTable, AssetPricing>("data", OBJECT_MAPPER)
val data = jsonb<AssetPricingTable, AssetPricing>("data", OBJECT_MAPPER).nullable()

Choose a reason for hiding this comment

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

Just verifying since I don't see a DB migration here, the current column in the db is nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is. I just needed a way to set it on the kotlin side to null for updates.

I will be removing this column in the future anyway: #563

It was saving the json that was returned from figure pricing, which didn't have any extra information that wasn't already being saved as a column.

@nullpointer0x00 nullpointer0x00 merged commit a63258a into main Oct 18, 2024
4 checks passed
@nullpointer0x00 nullpointer0x00 deleted the nullpointer0x00/set-data-column-to-null-asset-pricing branch October 18, 2024 15:30
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.

2 participants