Skip to content

Commit

Permalink
Clarified usage of replace parameter in insert_rows
Browse files Browse the repository at this point in the history
Re-introduced the replace boolean parameter.
Added a warning when the user sets the replace parameter to True.
Updated the docstring to let the user know that the replace boolean parameter does nothing.
  • Loading branch information
RichieSK committed May 4, 2024
1 parent f534c07 commit 401674a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion airflow/providers/oracle/hooks/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def insert_rows(
table: str,
rows: list[tuple],
target_fields=None,
commit_every: int = 1000
commit_every: int = 1000,
replace: bool | None = False,
**kwargs,
) -> None:
"""Insert a collection of tuples into a table.
Expand All @@ -271,7 +272,10 @@ def insert_rows(
:param commit_every: the maximum number of rows to insert in one transaction
Default 1000, Set greater than 0.
Set 1 to insert each row in each single transaction
:param replace: Does not do anything.
"""
if replace:
warnings.warn("Using 'replace=True' does not implement any replace functionality currently.", category=UserWarning, stacklevel=2)
try:
import numpy as np
except ImportError:
Expand Down

0 comments on commit 401674a

Please sign in to comment.