Skip to content

Commit

Permalink
Remove __index_level_0__ from csv exports
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Aug 11, 2023
1 parent 8627dc0 commit 2dcf2af
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/data_common/dataset/resource_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,12 @@ def copy_resources(self):
csv_copy_query = """
copy (select * from {{ source }}) to {{ dest }} (format PARQUET);
"""
exclude = ""

# __index_level_0__ is an internal parquet column that duckdb has access to
# but we don't want to export
exclude = "EXCLUDE __index_level_0__"
if desc["custom"].get("is_geodata", False):
exclude = "EXCLUDE geometry"
exclude = "EXCLUDE __index_level_0__, geometry"

parquet_copy_query = """
copy (select * {{ exclude }} from {{ source }}) to {{ dest }} (HEADER, DELIMITER ',');
Expand Down

0 comments on commit 2dcf2af

Please sign in to comment.