-
Notifications
You must be signed in to change notification settings - Fork 372
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
[BREAKING] Circular ref bug show #2200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I wonder whether we couldn't just adapt the show
method for data frames so that they check :compact
or :limited
and show only the summary in that case.
I would leave it for a separate PR (as it probably will lead to a cascade of other things to check - I am just not sure that I can get it 100% right then - these |
Co-Authored-By: Milan Bouchet-Valat <[email protected]>
…ular_ref_bug_show
All suggestions are applied. I think the major decision is what to do with |
Thank you. I will merge it after #2911 is done. |
Fixes #2135
This is not a full fix, as Base is much better at detecting circular references, but doing it right would require a much bigger rewrite of the code. Now we correctly handle 1-level of indirection (but do not correctly handle a case when e.g. a data frame would contain a vector containing a dict containing the original data frame - but I think this case is so obscure that it can be skipped).
Additionally now we:
missing
,nothing
and#undef
consistently everywhere (text, LaTeX, HTML, CSV, TSV) - the only restriction I left is CSV and TSV throwing an error when trying to write #undefmissing
,nothing
and#undef
everywhere (text, LaTeX, HTML) - so they are never mixed up with stringsAbstractDataFrame
,DataFrameRow
,DataFrameRows
,DataFrameColumns
orGroupedDataFrame
is stored in a data frame then only its summary is printed (this makes printing much nicer (otherwise the output were not readable anyway) - and as a side effect - avoids the original circular reference problem)Finally this PR fixes a problem that old printing mechanism in DataFrames.jl was not thread safe. After fixing it is thread safe (we do not reuse one global
buffer
but allocate it anew for each top-level call ofshow
).This PR is largely orthogonal to #2199 and can be merged post 0.21 release, but before 1.0 release as it is mildly breaking.