We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f375f3 commit 0546cefCopy full SHA for 0546cef
CHANGES.md
@@ -3,6 +3,8 @@
3
4
## Unreleased
5
6
+- datasets: Fix dataset loader
7
+
8
9
## 2024/03/07 v0.0.6
10
cratedb_toolkit/datasets/model.py
@@ -103,10 +103,12 @@ def load(
103
cardinality = self.db.count_records(self.table, errors="ignore")
104
has_data = cardinality > 0
105
106
- if not has_data and not if_exists == "noop":
107
- if self.init_sql is None:
108
- raise ValueError("SQL for loading data is missing")
109
- self.run_sql(self.init_sql)
+ if if_exists == "noop" and has_data:
+ return
+ if self.init_sql is None:
110
+ raise ValueError("SQL for loading data is missing")
111
+ self.run_sql(self.init_sql)
112
113
def run_sql(self, sql: str):
114
for statement in sqlparse.parse(sql):
0 commit comments