datapane / datapane

Build and share data reports in 100% Python

Home Page:https://datapane.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binary columns rendered as boolean values

tr31zh opened this issue · comments

System Information

  • OS: MacOS 12.5.1
  • Python version: 3.10.6
  • Python environment: pip
  • Using jupyter: true
  • Datapane version: 0.15.0

Bug / Issue

When using dataframes, binary columns are rendrered as boolean values
ex:

dp.DataTable( pd.DataFrame( { 1: [1, 0, 0, 1], 2: [1, 0, 0, 1], 3: [1, 0, 0, 1], 4: [1, 0, 0, 1], 5: [1, 0, 0, 1], 6: [1, 0, 0, 1], } ) )
Will be rendered as:
1 2 ...
True True ...
False False. ...

Hey @tr31zh ! Thank you for raising this. It looks like it may be a result of a recent update that included this PR. #256.

@mands although it's an optimisation feature, we may need to re-think it if the outcome is undesirable!

@shahinrostami agreed, yes let's disable this optimisation and do a patch release. I assume the integer optimisation will kick in anyway and it will store these as uint8 anyway which is still a size saving

Just a heartbeat to confirm that I'll be picking this one up today 👍

Pending a review, this fix should make it into our release! I'll label this issue as release pending for now.

Re-opening until the fix makes it into a release

Hey @tr31zh - this should have been fixed in the recent release! I've confirmed it with the example:

import datapane as dp
import pandas as pd

app = dp.App(
    dp.DataTable(
        pd.DataFrame(
            {
                1: [1, 0, 0, 1],
                2: [1, 0, 0, 1],
                3: [1, 0, 0, 1],
                4: [1, 0, 0, 1],
                5: [1, 0, 0, 1],
                6: [1, 0, 0, 1],
            }
        )
    )
).save("test.html")

Screenshot 2022-09-22 at 19 21 23

Thank you for raising this – please let us know if there's anything else!

Hi @shahinrostami ,
I've just checked, everything looks fine.
Thank you!

Hi @shahinrostami ,
I've just checked, everything looks fine.
Thank you!

Perfect, happy to hear it!