Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Float data is being returned as strings rather than numbers

    We recently upgraded to SmartClient v10.1p_2016-02-24/PowerEdition Deployment (built 2016-02-24). We are now seeing cases where floating point numbers (Double's in Java, float in the SmartClient data source) are being returned as strings rather than as numbers.

    We are using Chrome on the Mac, Version 48.0.2564.116 (64-bit).

    Here is the datasource:
    <DataSource
    ID="StudyIncidenceDataDS"
    serverType="generic"
    >
    <fields>
    <field name="totalPopulation" title="total population" type="integer" isIdentity="false" useAsFormField="true"/>
    <field name="numberMutations" title="number mutations" type="integer" isIdentity="false" useAsFormField="true"/>
    <field name="incidence" title="incidence" type="float" isIdentity="false" useAsFormField="true"/>
    <field name="id" title="id" type="text" isIdentity="false" useAsFormField="true" length="36" hidden="true" primaryKey="true" />
    <field name="study" title="study" type="text" />
    <field name="biomarker" title="biomarker" type="text" />
    <field name="disease" title="disease" type="text" />
    </fields>
    <serverObject ID="incidenceDataHandler" lookupStyle="new" className="com.nofone.mm.dmi.IncidenceDataDMI"/>
    </DataSource>

    An example of a response that we are seeing is:

    {
    affectedRows:0,
    data:[
    {
    id:"INCID.798386",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Abdominal carcinosarcoma",
    totalPopulation:0
    },
    {
    id:"INCID.798557",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Acinic cell tumor",
    totalPopulation:1
    },
    {
    id:"INCID.798924",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Acral melanoma",
    totalPopulation:7
    },
    {
    id:"INCID.798975",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Acute basophilic leukemia",
    totalPopulation:0
    },
    {
    id:"INCID.799031",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Acute lymphocytic leukemia (ALL)",
    totalPopulation:50
    },
    {
    id:"INCID.798765",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Acute lymphocytic leukemia (Ph+)",
    totalPopulation:0
    },
    {
    id:"INCID.798766",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Acute lymphocytic leukemia (Ph-)",
    totalPopulation:0
    },
    {
    id:"INCID.798958",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Acute monoblastic leukemia",
    totalPopulation:0
    },
    {
    id:"INCID.798801",
    biomarker:"KLK2",
    numberMutations:2,
    incidence:"0.48661800486618007",
    disease:"Acute myelocytic leukemia (AML)",
    totalPopulation:411
    },
    {
    id:"INCID.798887",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Acute myelocytic leukemia (AML), NOS",
    totalPopulation:0
    },
    {
    id:"INCID.799061",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Acute promyelocytic leukemia (APL)",
    totalPopulation:0
    },
    {
    id:"INCID.798385",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Adenocarcinoma of the nasopharynx",
    totalPopulation:0
    },
    {
    id:"INCID.799066",
    biomarker:"KLK2",
    numberMutations:71,
    incidence:"0.38118758724363794",
    disease:"Adenocarcinoma of unknown primary",
    totalPopulation:18626
    },
    {
    id:"INCID.799017",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Adenocarcinoma, intestinal type",
    totalPopulation:0
    },
    {
    id:"INCID.798587",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Adenoid cystic carcinoma",
    totalPopulation:60
    },
    {
    id:"INCID.798590",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Adnexal carcinoma of the skin",
    totalPopulation:0
    },
    {
    id:"INCID.798938",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Adrenal adenocarcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798892",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Adrenal carcinoma",
    totalPopulation:76
    },
    {
    id:"INCID.798478",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Adrenal cortical carcinoma",
    totalPopulation:67
    },
    {
    id:"INCID.798534",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Adrenal neuroblastoma",
    totalPopulation:0
    },
    {
    id:"INCID.798831",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Adult T-cell leukemia/lymphoma (ATLL)",
    totalPopulation:1
    },
    {
    id:"INCID.798589",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Alveolar soft part sarcoma",
    totalPopulation:0
    },
    {
    id:"INCID.798984",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Ameloblastic carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.799060",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Ameloblastic fibrosarcoma",
    totalPopulation:0
    },
    {
    id:"INCID.798998",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Ameloblastoma",
    totalPopulation:0
    },
    {
    id:"INCID.798890",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"AML with myelodysplasia-related changes (AML-MRC)",
    totalPopulation:7
    },
    {
    id:"INCID.798886",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"AML with recurrent genetic abnormalities",
    totalPopulation:0
    },
    {
    id:"INCID.799039",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Ampullary adenocarcinoma",
    totalPopulation:1
    },
    {
    id:"INCID.798901",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anal adenocarcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798481",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anal basaloid carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798764",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anal carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798473",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anal melanoma",
    totalPopulation:0
    },
    {
    id:"INCID.799012",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anal neuroendocrine carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798791",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anal squamous cell carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798430",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Anaplastic astrocytoma",
    totalPopulation:51
    },
    {
    id:"INCID.798923",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anaplastic ependymoma",
    totalPopulation:0
    },
    {
    id:"INCID.798775",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Anaplastic glioma",
    totalPopulation:0
    },
    {
    id:"INCID.798732",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Anaplastic large cell lymphoma",
    totalPopulation:2
    },
    {
    id:"INCID.798913",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Anaplastic oligoastrocytoma",
    totalPopulation:8
    },
    {
    id:"INCID.798944",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Anaplastic oligodendroglioma",
    totalPopulation:19
    },
    {
    id:"INCID.798449",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Anaplastic thyroid carcinoma ",
    totalPopulation:6
    },
    {
    id:"INCID.798990",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Angiocentric glioma",
    totalPopulation:0
    },
    {
    id:"INCID.798947",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Angioimmunoblastic t-cell lymphoma",
    totalPopulation:7
    },
    {
    id:"INCID.798467",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Angiolipoma",
    totalPopulation:0
    },
    {
    id:"INCID.798797",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Angiomatoid fibrous histiocytoma",
    totalPopulation:0
    },
    {
    id:"INCID.798617",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Angiomyolipoma",
    totalPopulation:0
    },
    {
    id:"INCID.798726",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Angiomyxoma",
    totalPopulation:0
    },
    {
    id:"INCID.798763",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Angiosarcoma",
    totalPopulation:11
    },
    {
    id:"INCID.798692",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Aplastic anemia",
    totalPopulation:0
    },
    {
    id:"INCID.798796",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Appendix adenocarcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798770",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Appendix carcinoid tumor",
    totalPopulation:0
    },
    {
    id:"INCID.799055",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Appendix carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798716",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Appendix mucinous tumor",
    totalPopulation:0
    },
    {
    id:"INCID.798728",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Astrocytoma",
    totalPopulation:57
    },
    {
    id:"INCID.798906",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Atypical chronic myeloid leukemia/Chronic neutrophilic leukemia (atypical CML/CNL)",
    totalPopulation:0
    },
    {
    id:"INCID.798710",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Atypical fibroxanthoma",
    totalPopulation:0
    },
    {
    id:"INCID.798522",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Atypical lung carcinoid",
    totalPopulation:7
    },
    {
    id:"INCID.798450",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Atypical teratoid rhabdoid tumor (AT/RT)",
    totalPopulation:22
    },
    {
    id:"INCID.798851",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"B-cell acute lymphoblastic leukemia",
    totalPopulation:106
    },
    {
    id:"INCID.798949",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"B-cell lymphoma",
    totalPopulation:390
    },
    {
    id:"INCID.799010",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"B-cell prolymphocytic leukemia",
    totalPopulation:0
    },
    {
    id:"INCID.798992",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Basal cell carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798479",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Basaloid squamous cell carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798737",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bellini duct carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.799000",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bile duct squamous cell carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798482",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bladder adenocarcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798666",
    biomarker:"KLK2",
    numberMutations:1,
    incidence:"0.35842293906810035",
    disease:"Bladder carcinoma",
    totalPopulation:279
    },
    {
    id:"INCID.799028",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bladder carcinosarcoma",
    totalPopulation:0
    },
    {
    id:"INCID.798715",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bladder leiomyosarcoma",
    totalPopulation:0
    },
    {
    id:"INCID.798625",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bladder neuroendocrine carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798483",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bladder sarcoma",
    totalPopulation:0
    },
    {
    id:"INCID.798671",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bladder small cell carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.798576",
    biomarker:"KLK2",
    numberMutations:0,
    disease:"Bladder squamous cell carcinoma",
    totalPopulation:0
    },
    {
    id:"INCID.799048",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Bladder urothelial (transitional cell) carcinoma",
    totalPopulation:113
    },
    {
    id:"INCID.798853",
    biomarker:"KLK2",
    numberMutations:0,
    incidence:0,
    disease:"Blastic plasmacytoid dendritic cell neoplasm",
    totalPopulation:3
    }
    ],
    endRow:75,
    invalidateCache:false,
    isDSResponse:true,
    operationType:"fetch",
    queueStatus:0,
    startRow:0,
    status:0,
    totalRows:687
    }

    See the bolded line where the incidence value is a string even though in the data source definition it was defined as a float.

    The Java code that generates this data is:
    protected Map<String, Object> mapValues(IncidenceData data,
    PersistentObjectManager pom, DSRequest dsRequest) throws Throwable {
    Map<String,Object> map = new Hashtable <String,Object>();
    map.put("id", data.getId());
    if (data.getCbioportalStudy() != null) {
    map.put("study", data.getCbioportalStudy().getStudyLongName());
    }
    map.put("biomarker", data.getBiomarker().getFullName());
    map.put("disease", data.getDisease().getName());
    if (data.getIncidence() != null) {
    map.put("incidence", data.getIncidence());
    }
    if (data.getTotalPopulation() != null) {
    map.put("totalPopulation", data.getTotalPopulation());
    }
    if (data.getNumberMutations() != null) {
    map.put("numberMutations", data.getNumberMutations());
    }
    return map;
    }

    where data.getIncidence() is returning a double.

    We did not see this problem in the prior version of SmartClient that we were using, v10.0p_2015-09-22/PowerEdition Deployment (built 2015-09-22).

    Has this problem been reported before? Is there any chance that it is fixed in newer SmartClient 10 builds?

    Thanks
    Chuck




    #2
    This is by design - conversion to String is done automatically for values that cannot be represented in JavaScript without loss of precision. See dataSourceField.stringInBrowser for how to turn this off if it is not desirable for you.

    Comment

    Working...
    X