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

Hotfix - Type Analyzer unable to identify the column #217

Open
CodesAreHonest opened this issue May 12, 2022 · 0 comments
Open

Hotfix - Type Analyzer unable to identify the column #217

CodesAreHonest opened this issue May 12, 2022 · 0 comments

Comments

@CodesAreHonest
Copy link
Contributor

CodesAreHonest commented May 12, 2022

Current Behavior

type-analyser unable to identify the column data type and hide the column once the column type is unknown. At the same time, csv2json function will convert the string into numeric if found the string contents are all number.

The above behaviour caused the source value in Edge Source column missing in Import Wizard.

Screenshot 2022-05-12 at 4 28 45 PM

Possible Implementation

  1. Use a better type-analyser library to correctly identify the column type.
  2. csv2json function should not transform the data type. The function should retain the data type instead of transforming it, leaving a choice for user to identify the data type for that specific column for any reason.

Sample Data

{
  "data": [
    {
      "nodes": [
        {
          "node_id": "70190026",
          "node_type": "custid",
          "beneid": null,
          "bene_name": null,
          "cust_type": "Personal",
          "BeneType": null,
          "id": "70190026"
        },
        {
          "node_id": "70210146",
          "node_type": "custid",
          "beneid": null,
          "bene_name": null,
          "cust_type": "Corporate",
          "BeneType": null,
          "id": "70210146"
        },
        {
          "node_id": "22503",
          "node_type": "groupbeneid",
          "beneid": "121125,163559",
          "bene_name": "TANG JIAN GUANG \u6c64\u5251\u5149,TANG JIAN GUANG \u6c64\u5251\u5149",
          "cust_type": null,
          "BeneType": "Personal",
          "id": "22503"
        },
        {
          "node_id": "3000",
          "node_type": "groupbeneid",
          "beneid": "111",
          "bene_name": "lambda",
          "cust_type": null,
          "BeneType": "Personal",
          "id": "3000"
        },
        {
          "node_id": "S8108181F",
          "node_type": "ic",
          "beneid": null,
          "bene_name": null,
          "cust_type": null,
          "BeneType": null,
          "id": "S8108181F"
        },
        {
          "node_id": "LI JIWEN",
          "node_type": "beneficialOwner",
          "beneid": null,
          "bene_name": null,
          "cust_type": null,
          "BeneType": null,
          "id": "LI JIWEN"
        }
      ],
      "edges": [
        {
          "source": "70190026",
          "target": "22503",
          "sgdAmt": 1169.67,
          "edge_type": "sends to",
          "id": 0
        },
        {
          "source": "70190026",
          "target": "3000",
          "sgdAmt": 234.0,
          "edge_type": "sends to",
          "id": 1
        },
        {
          "source": "70210146",
          "target": "22503",
          "sgdAmt": 387.86,
          "edge_type": "sends to",
          "id": 2
        },
        {
          "source": "S8108181F",
          "target": "70190026",
          "sgdAmt": null,
          "edge_type": "ATP of",
          "id": 3
        },
        {
          "source": "S8108181F",
          "target": "70210146",
          "sgdAmt": null,
          "edge_type": "ATP of",
          "id": 4
        },
        {
          "source": "LI JIWEN",
          "target": "70210146",
          "sgdAmt": null,
          "edge_type": "beneficiary owner of",
          "id": 5
        }
      ],
      "metadata": {
        "fields": {
          "nodes": [
            {
              "name": "node_id",
              "format": "",
              "type": "integer",
              "analyzerType": "INT"
            },
            {
              "name": "node_type",
              "format": "",
              "type": "string",
              "analyzerType": "STRING"
            },
            {
              "name": "beneid",
              "format": "",
              "type": "integer",
              "analyzerType": "INT"
            },
            {
              "name": "bene_name",
              "format": "",
              "type": "string",
              "analyzerType": "STRING"
            },
            {
              "name": "cust_type",
              "format": "",
              "type": "string",
              "analyzerType": "STRING"
            },
            {
              "name": "BeneType",
              "format": "",
              "type": "string",
              "analyzerType": "STRING"
            },
            {
              "name": "id",
              "format": "",
              "type": "integer",
              "analyzerType": "INT"
            }
          ],
          "edges": [
            {
              "name": "source",
              "format": "",
              "type": "string",
              "analyzerType": "STRING"
            },
            {
              "name": "target",
              "format": "",
              "type": "integer",
              "analyzerType": "INT"
            },
            {
              "name": "sgdAmt",
              "format": "",
              "type": "real",
              "analyzerType": "FLOAT"
            },
            {
              "name": "edge_type",
              "format": "",
              "type": "string",
              "analyzerType": "STRING"
            },
            {
              "name": "id",
              "format": "",
              "type": "integer",
              "analyzerType": "INT"
            }
          ]
        },
        "key": null,
        "groupEdges": { "toggle": false, "availability": false }
      }
    }
  ],
  "style": {
    "layout": { "type": "radial" },
    "nodeStyle": {
      "color": {
        "variable": "node_type",
        "id": "legend",
        "mapping": {
          "custid": "#4e79a7",
          "groupbeneid": "#f28e2c",
          "ic": "#e15759",
          "beneficialOwner": "#76b7b2"
        }
      },
      "size": { "id": "fixed", "value": 12 },
      "label": ["node_id", "cust_type", "BeneType"],
      "fontSize": 12
    },
    "edgeStyle": {
      "width": { "id": "fixed", "value": 1 },
      "label": ["edge_type", "sgdAmt"],
      "fontSize": 12,
      "color": { "id": "fixed", "value": "rgba(105, 123, 140,1)" }
    }
  },
  "filter": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant