This message was deleted.
# general
s
This message was deleted.
s
There's shouldn't be a limit of 50 chars, at least not one I'm aware of. Where are you seeing this?
a
hm, I am trying to groupby by columns that have names with dots but dont represent any table names (eg some.column.name) which confuses somehow the daft's sql parser, so I tried to escape them with ' and noticed that columns with names longer than 50 chars get cut off at 50th character, weird
c
just to confirm, is this only an issue with daft sql? are you able to perform the operations using the dataframe api without issue?
a
I am using dataframe api not sql api
df_aggregated = df.groupby(*groupby_cols).agg(*aggs)
c
are you able to create a MRE (minimum reproducible example)?
a
I am porting some data mapping sql queries from sqlachemy to daft, the resulting dataframe looks like this
Copy code
df = daft.from_pylist(
        [
            {
                "row_id": 13,
                "subject_id": 16,
                "Encounter.class.code": "IMP",
                "Encounter.diagnosis.2.condition.identifier.value": "103251_admission",
                "Encounter.class.system": "<http://terminology.hl7.org/CodeSystem/v3-ActCode>",
                "Encounter.hospitalization.dischargeDisposition.coding.0.code": "home",
                "Encounter.subject.identifier.value": 16,
                "hadm_id": 103251,
                "Encounter.identifier.0.value": 103251,
                "Encounter.length.value": 188160.0,
                "Encounter.class.display": "inpatient encounter",
                "Encounter.hospitalization.admitSource.coding.0.display": "Medical Practitioner/physician referral",
                "Encounter.hospitalization.admitSource.coding.0.code": "mp",
                "Encounter.hospitalization.dischargeDisposition.coding.0.display": "Home",
                "Encounter.period.start": datetime.datetime(2178, 2, 3, 6, 35),
                "Encounter.diagnosis.1.condition.identifier.value": "70_103251_3",
                "Encounter.period.end": datetime.datetime(2178, 2, 5, 10, 51),
                "Encounter.diagnosis.0.condition.identifier.value": "9679_1_103251",
                "Encounter.hospitalization.admitSource.text": None,
            }
        ]
    )

groupby_cols = ["subject_id", "hadm_id", "row_id"]
agg_cols = [col for col in df.column_names if col not in groupby_cols]
aggs = [daft.col(col).list_agg().alias(col) for col in agg_cols]
c
hmm that example runs just fine for me.
Copy code
╭────────────┬─────────┬────────┬─────────────┬────────────────────────┬───────────────────────────────╮
│ subject_id ┆ hadm_id ┆ row_id ┆      …      ┆ Encounter.period.start ┆ Encounter.subject.identifier. │
│ ---        ┆ ---     ┆ ---    ┆             ┆ ---                    ┆ value                         │
│ Int64      ┆ Int64   ┆ Int64  ┆ (14 hidden) ┆ List[Timestamp[us]]    ┆ ---                           │
│            ┆         ┆        ┆             ┆                        ┆ List[Int64]                   │
╞════════════╪═════════╪════════╪═════════════╪════════════════════════╪═══════════════════════════════╡
│ 16         ┆ 103251  ┆ 13     ┆ …           ┆ [2178-02-03 06:35:00]  ┆ [16]                          │
╰────────────┴─────────┴────────┴─────────────┴────────────────────────┴───────────────────────────────╯

(Showing first 1 of 1 rows)