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

Infer Schema functionality breaks some examples #368

Closed
matt-hooper opened this issue Jan 7, 2019 · 6 comments
Closed

Infer Schema functionality breaks some examples #368

matt-hooper opened this issue Jan 7, 2019 · 6 comments
Assignees
Labels
bug Concrete, reproducible bugs

Comments

@matt-hooper
Copy link
Contributor

It appears that the infer schema functionality changed between 0.2.9 and 0.2.11. This has broken some json based examples.

For example, the cryptocurrency example does not work using 0.2.10 (and above) of perspective.
The example reads from a json feed and auto-generates the table schema.

The generated schema is different between the two versions (even though the data from the feed is identical):

Version 0.2.9 Version 0.2.10
client_oid: "string" -
order_id: "string" order_id: "string"
order_type: "string" -
price: "float" price: "float"
product_id: "string" product_id: "string"
- remaining_size: "float"
sequence: "float" sequence: "float"
side: "string" side: "string"
size: "float" -
time: "datetime" time: "datetime"
type: "string" type: "string"

The renaming of the size field to remaining_size breaks the example:
image

I have also seen a similar issue with a different json based data source.
See attached example forecast_min.zip
forecast_min.zip

This example reads data from a json file.
When using 0.2.9 of perspective, the types of the data are correctly inferred:

image

When 0.2.11 is used, the types are all read as string values. None of the number types are inferred:

image

Is this new functionality intended?
Is it possible to force perspective to work in the old way and auto infer the number values (without manually passing a pre-defined schema)?

@timkpaine timkpaine added the bug Concrete, reproducible bugs label Jan 7, 2019
@sc1f
Copy link
Contributor

sc1f commented Jan 7, 2019

Definitely a bug inside the type parser—currently working on a fix. Thanks for the report!

@sc1f
Copy link
Contributor

sc1f commented Jan 7, 2019

@matt-hooper is the crypto example you mention the one on bl.ocks.org? I have the issue fixed for your forecast data, but I want to see if it fixes the issue on the crypto example as well. Thanks!

@matt-hooper
Copy link
Contributor Author

@sc1f, yes that is correct. I downloaded the example locally and switched the cdn reference for perspective to a local one, that is when I spotted the issue.

@sc1f
Copy link
Contributor

sc1f commented Jan 7, 2019

@matt-hooper the issue looks like it's been resolved for both examples. If you pull the optimize-data-accessor branch, would you let me know if it's been fixed on your end? Thanks!

@matt-hooper
Copy link
Contributor Author

@sc1f - I have pulled the optimize-data-accessor branch and tested it locally and both issues have been resolved. Thanks for the quick response.

@texodus
Copy link
Member

texodus commented Jan 18, 2019

Thanks for the report, this is fixed in 0.2.12

@texodus texodus closed this as completed Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Concrete, reproducible bugs
Projects
None yet
Development

No branches or pull requests

4 participants