Comments (3)
I like the naming, and I like option 3 for the arg names.
from dbt-fal.
As discussed in a meeting, let's do:
append
: the default behaviour that writes data to source with no deduplication measuresupsert
: based on a given column, do a typical UPSERT operation-- Postgres example INSERT INTO distributors (id_col, dname) VALUES (5, 'Gizmo Transglobal'), (6, 'Associated Computing, Inc') ON CONFLICT (id_col) DO UPDATE SET dname = EXCLUDED.dname; -- Note that the special excluded table is used to reference values originally proposed for insertion
overwrite
: Delete the contents of the table on the source and rewrite it
Then, this would be passed in a mode
argument
def write_to_source(
self,
data: pd.DataFrame,
target_source_name: str,
target_table_name: str,
mode: dict[str, str],
dtype: Any = None,
):
and mode
can have the values like
mode={'type': 'append'}
mode={'type': 'upsert', 'column': 'id_col'}
mode={'type': 'overwrite'}
or... we could do:
mode='append'
mode={'type': 'upsert', 'column': 'id_col'}
mode='overwrite'
or... we could add a new optional argument which we read only for upsert
mode:
mode='append'
mode='upsert', upsert_column='id_col'
mode='overwrite'
from dbt-fal.
We did overwrite in #224, but have not done upsert yet. For now upsert is for the user (download the dataframe, update it locally, overwrite it) to do, since doing it on our side is not trivial (many adapters to support) and want to maybe consider how to do it better.
If anyone needs upsert, open a ticket and we will consider re-prioritizing it.
from dbt-fal.
Related Issues (20)
- fix fal serverless support with 'packaging' package HOT 1
- Python for Athena not working HOT 3
- fal is not compatible with dbt 1.5.0 HOT 3
- Incremental processing within a Python model HOT 2
- Case sensitive naming leads to a "When searching for a relation, dbt found an approximate match" error HOT 1
- Please make fal compatible with Python 3.11
- upgrade to support dbt-core v1.6.0 HOT 1
- Core dump using dbt-fal 1.5.4 with dbt-core 1.5.2 HOT 4
- Upgrading dbt-core from 1.5.1 to 1.5.2+ forces downgrade of dbt-fal to 1.5.4 HOT 1
- python models to support persist_docs
- Please support dbt-clickhouse
- support doris please. HOT 1
- DEBUG level logs shown and can't change log level HOT 1
- Support latest version of dbt-athena
- Please support dbt-doris
- Run fal script on tag level instead of individual model
- Pydantic 2.0 + Request
- upgrade to support dbt-core v1.7.0 HOT 4
- Post-hooks do not work for Python models with dbt-fal, postgres adapter
- Is dbt-fal abandonware? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbt-fal.