Skip to content

fix deprecation and possible faulty construction of pandas tables #221

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

Merged
merged 3 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PythonCall"
uuid = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
authors = ["Christopher Doris <github.com/cjdoris>"]
version = "0.9.6"
version = "0.9.7"

[deps]
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
Expand Down
2 changes: 1 addition & 1 deletion src/pywrap/PyPandasDataFrame.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,6 @@ function _columns(df, columnnames, columntypes)
# output a table
# TODO: realising columns to vectors could be done lazily with a different table type
schema = Tables.Schema(colnames, coltypes)
coldict = Dict(k=>v for (k,v) in zip(colnames, columns))
coldict = Tables.OrderedDict(k=>v for (k,v) in zip(colnames, columns))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good thanks. It unfortunately uses the non-API Tables.OrderedDict, but then we're already using the non-API constructor for Tables.DictColumnTable so 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's not great but I figured it would be easier on everyone... it's not really an ideal API on the Tables end.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll think about a PR to Tables to give some of its table types public constructors.

Tables.DictColumnTable(schema, coldict)
end