Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: error at construction time for illegal casts #10213

Open
1 task done
NickCrews opened this issue Sep 24, 2024 · 0 comments
Open
1 task done

feat: error at construction time for illegal casts #10213

NickCrews opened this issue Sep 24, 2024 · 0 comments
Labels
feature Features or general enhancements

Comments

@NickCrews
Copy link
Contributor

Is your feature request related to a problem?

Consider ibis.literal(1).cast("array<int64>"). This currently doesn't error. It only errors once you try to execute the result. I don't think there is any backend where this cast would succeed. It would be great if I got this error as early as possible.

We DON'T want to be overly-sensitive, and disallow a cast that is actually implemented by a backend, but I think there are a subset of casts that we could be sure aren't illegal., and we should error earlier. Initial first thoughts:

  • non-string to struct
  • non-string to array
  • non-string to map
  • struct to non-string
  • array to non-string
  • map to non-string
  • non-binary and non-string to geom
  • geom to non-binary and non-string

What is the motivation behind your request?

I'm getting errors, but it was tricky to debug the code at fault, since it happened so much earlier.

Describe the solution you'd like

Use the already-implemented castable() function?

What version of ibis are you running?

main

What backend(s) are you using, if any?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@NickCrews NickCrews added the feature Features or general enhancements label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
Status: backlog
Development

No branches or pull requests

1 participant