DataJunction / dj

A metrics platform.
http://datajunction.io
MIT License
29 stars 13 forks source link

change create_ methods into upsert_ #996

Closed anhqle closed 1 month ago

anhqle commented 1 month ago

Summary

This PR changes the create_somenode methods into upsert_somenode, which create if a node doesn't exist and update if it does exist.

This is useful because users just want to "make the nodes this way" without having to first check for existence. An example use case is writing a notebook with a bunch of upsert, which would be reproducible and idempotent.

The commit so far only changes create_source into upsert_source. If the approach makes sense I'll make the same changes to other nodes types & and add tests.

Test Plan

Deployment Plan

anhqle commented 1 month ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @anhqle and the rest of your teammates on Graphite Graphite

netlify[bot] commented 1 month ago

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
Latest commit 899ad81ae07024ba23e954fd943a1de09bf21f7c
Latest deploy log https://app.netlify.com/sites/thriving-cassata-78ae72/deploys/6645712ea1846a00088972b4
anhqle commented 1 month ago

This functionality is added in #1001 instead