Skip to content

Commit

Permalink
feat(data-warehouse): add support for csv import with header (#22990)
Browse files Browse the repository at this point in the history
* add support for csv with headesr

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* reorder

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* Update UI snapshots for `chromium` (1)

* rename

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
EDsCODE and github-actions[bot] authored Jun 17, 2024
1 parent 7c0ea97 commit 5590230
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export function DatawarehouseTableForm(): JSX.Element {
options={[
{ label: 'Parquet (recommended)', value: 'Parquet' },
{ label: 'CSV', value: 'CSV' },
{ label: 'CSV with headers', value: 'CSVWithNames' },
{ label: 'JSON', value: 'JSONEachRow' },
]}
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3764,14 +3764,14 @@ export interface DataWarehouseTable {
/** UUID */
id: string
name: string
format: string
format: DataWarehouseTableTypes
url_pattern: string
credential: DataWarehouseCredential
external_data_source?: ExternalDataStripeSource
external_schema?: SimpleExternalDataSourceSchema
}

export type DataWarehouseTableTypes = 'CSV' | 'Parquet'
export type DataWarehouseTableTypes = 'CSV' | 'Parquet' | 'JSON' | 'CSVWithNames'

export interface DataWarehouseSavedQuery {
/** UUID */
Expand Down
2 changes: 1 addition & 1 deletion latest_migrations.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ contenttypes: 0002_remove_content_type_name
ee: 0016_rolemembership_organization_member
otp_static: 0002_throttling
otp_totp: 0002_auto_20190420_0723
posthog: 0428_externaldataschema_sync_type
posthog: 0429_alter_datawarehousetable_format
sessions: 0001_initial
social_django: 0010_uid_db_index
two_factor: 0007_auto_20201201_1019
25 changes: 25 additions & 0 deletions posthog/migrations/0429_alter_datawarehousetable_format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.2.11 on 2024-06-14 19:56

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("posthog", "0428_externaldataschema_sync_type"),
]

operations = [
migrations.AlterField(
model_name="datawarehousetable",
name="format",
field=models.CharField(
choices=[
("CSV", "CSV"),
("CSVWithNames", "CSVWithNames"),
("Parquet", "Parquet"),
("JSONEachRow", "JSON"),
],
max_length=128,
),
),
]
1 change: 1 addition & 0 deletions posthog/warehouse/models/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
class DataWarehouseTable(CreatedMetaFields, UUIDModel, DeletedMetaFields):
class TableFormat(models.TextChoices):
CSV = "CSV", "CSV"
CSVWithNames = "CSVWithNames", "CSVWithNames"
Parquet = "Parquet", "Parquet"
JSON = "JSONEachRow", "JSON"

Expand Down

0 comments on commit 5590230

Please sign in to comment.