Skip to content

Using constructor.name for dataType.variant seems not to be reliable #372

@roll

Description

@roll

Have you tried latest version of polars?

  • [yes]

What version of polars are you using?

0.21.2

What operating system are you using polars on?

Ubuntu 24

What node version are you using

Node 24

Describe your bug.

I ran into weird bug when type inference based on DataFrame logic didn't match between running my project in Node and in Bun-compiled binary. After digging in a little bit a found out that the datatype.variant differs in builds (which broke the following login in the function):

polarsField: { name: 'name', type: DataType(String) },
polarsField: { name: 'name', type: DataType(String2) },

It's X layers of indirection (builds/compilers/etc) to figure out why it acts like this so I guess a safer solution would be just using constant for type identities to eliminate this possibility

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions