Skip to content

Bug: Linux Ladybug 0.18 COPY FROM pandas DataFrame turns valid string primary keys into empty values #647

Description

@ahgh0

Ladybug version

18

What operating system are you using?

Ubuntu

What happened?

On Linux with Ladybug 0.18, COPY <node_table> FROM $df fails with a duplicate primary key error even though the pandas DataFrame primary-key column has no empty or duplicate values.

The same validator/data path works on Windows.

Ladybug in Linux should preserve the string id column values from the DataFrame and load all rows.
Actual: Ladybug reports duplicated empty primary key value, suggesting the DataFrame string column is converted/read as empty values inside COPY.

Error

RuntimeError: Copy exception: Found duplicated primary key value , which violates the uniqueness constraint of the primary key column.

### Are there known steps to reproduce?

Table
CREATE NODE TABLE xa(
  id STRING PRIMARY KEY,
  a_key STRING,
  a_name STRING,
  ordinal INT64,
  path STRING,
)
COPY call:
conn.execute("COPY xa FROM $df", {"df": df})
DataFrame validation before COPY
Immediately before the COPY call:
xa rows: 13117
empty ids: 0
duplicate ids: 0
first bad: []
So the source DataFrame does not contain empty or duplicate primary keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions