Skip to content

Dialyzer complains about ungroup with no colum names #1055

@viniciussbs

Description

@viniciussbs

Hi! I've mentioned in a closed issue about ungroup that I was experiencing an error when calling ungroup with no column names. But actually, the issue is different: it works, but Dialyzer complains about it.

The issue

This works:

[
  %{date: ~D[2025-01-14], id: 7, price: 4200},
  %{date: ~D[2025-01-14], id: 19, price: 5000},
  %{date: ~D[2025-01-15], id: 7, price: 4000},
  %{date: ~D[2025-01-15], id: 19, price: 5000}
]
|> DF.new()
|> DF.group_by(:date)
|> DF.summarise(price: min(price))
|> DF.ungroup() # no column names specified
|> DF.print()
+--------------------------------------------+
| Explorer DataFrame: [rows: 2, columns: 2]  |
+------------------------+-------------------+
|          date          |       price       |
|         <date>         |       <s64>       |
+========================+===================+
| 2025-01-14             | 4200              |
+------------------------+-------------------+
| 2025-01-15             | 4000              |
+------------------------+-------------------+

But Dialyzer complains:

lib/explorer_app.ex:4:no_return
Function test/0 has no local return.
________________________________________________________________________________
done (warnings were emitted)
Halting VM with exit status 2

Then you pass column names in ungroup:

|> DF.ungroup(:date)

And Dialyzer stops complaining:

done (passed successfully)

Repo reproducing the issue:

https://github.com/viniciussbs/explorer-app/tree/ungroup-and-dialyzer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions