You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// arrow to data view type mappings// see: https://github.com/finos/perspective/blob/master/packages/perspective/src/js/utils.js// and https://github.com/finos/perspective/blob/master/packages/perspective/src/js/perspective.js#ArrowColumnLoaderexportconstdataTypes={"Binary": "string","Bool": "boolean","Date": "date","Dictionary": "string","Float32": "float","Float64": "float","Int8": "integer","Int16": "integer","Int32": "integer","Int64": "integer","Timestamp": "datetime","Utf8": "string",};
after hours of code browsing, I found that your load({object, object} method lets me set data schema and utils.js#get_column_types() helped me infer what your corresponding arrow data types are.
Could use better enum or docs on this.
I ended up doing this in my data.preview.ts for arrow data types mapping:
// remap arrow data schema to columns for data viewerthis._schema={};dataTable.schema.fields.map(field=>{
let fieldType: string=field.type.toString();consttypesIndex: number=fieldType.indexOf('<');if(typesIndex>0){fieldType=fieldType.substring(0,typesIndex);}this._schema[field.name]=config.dataTypes[fieldType];});
No update; this is a valid issue, but not in my immediate dev plan. For now, perspective supports well only the base types supported by Javascript: 32bit signed int, double, string, bool, datetime. PRs welcome, as always.
You end all your close tickets with PRs are welcomed, yet you don't merge them due to CLA or some other not developed in house reasons. That 1 is kind of a sticky point for most devs working with data and your lib.
Support Question
I had to do this fine dance after looking at your
utils.js
andperspective.js#ArrowColumnLoader
to figure out how to inject arrow data types schema and translations into perspective.js from arrow data schema in myconfig.ts
: https://github.com/RandomFractals/vscode-data-preview/blob/master/src/config.tsafter hours of code browsing, I found that your
load({object, object}
method lets me set data schema andutils.js#get_column_types()
helped me infer what your corresponding arrow data types are.Could use better enum or docs on this.
I ended up doing this in my
data.preview.ts
for arrow data types mapping:and then this tricky biz in
data.preview.html
:It worked! I just wish I did not have to spend hours to figure it out. Thx!
BTW, your arrow data support is awesome! Check out mine too! :)
The text was updated successfully, but these errors were encountered: