question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Run data transformer on other types of inputs

See original GitHub issue

Right now, AFAIK, the data transformers are only run when a pandas dataframe is passed in: https://github.com/altair-viz/altair/blob/ee69e62c55847432178c2e52657b9cdcd98d8f43/altair/vegalite/v2/api.py#L26

However, I would like to be able to run a transformer when I pass in an ibis expression to a Chart. The transformer will take that ibis object and return a valid vega lite data dictionary.

The goal is for a user to easily compose visualizations from mapd expressions built with ibis, that are rendered with mapd’s vega renderer.

If Altair called the data transformer when it gets a recognized class, then I could get this to work. Another solution would be to expose a registry where users could register special transformations associated with difference classes. Then _prepare_data could use this registry.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ellisonbgcommented, Aug 18, 2018

I can imagine that it would be helpful to run the data transformation on all data types. One way we might want to design that is using multiple dispatch:

https://github.com/mrocklin/multipledispatch

Then it becomes much easier to write different combinations of transformers that have different implementations for different data types. Much better than different data transformers each having a bunch if/case logic switching on the types. Thoughts?

1reaction
jakevdpcommented, May 17, 2018

OK – let me know if a use-case for this comes up and we can think about how to make the plugin more configurable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use Data Transformers (Symfony Docs)
Data transformers are used to translate the data for a field into a format that can be displayed in a form (and back...
Read more >
Illustrated Guide to Transformers- Step by Step Explanation
You've probably heard of different famous transformers models like BERT, GPT, and GPT2. In this post, we'll focus on the one paper that ......
Read more >
Preprocess - Hugging Face
Transformers provides a set of preprocessing classes to help prepare your data ... Multimodal inputs, use a Processor to combine a tokenizer and...
Read more >
How to Use the ColumnTransformer for Data Preparation
Applying data transforms like scaling or encoding categorical variables is straightforward when all input variables are the same type.
Read more >
Column Transformer with Mixed Types - Scikit-learn
We can observe that the embarked and sex columns were tagged as category columns when loading the data with fetch_openml . Therefore, we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found