Add Indent Support in to_json by WillAyd · Pull Request #28130 · pandas-dev/pandas (original) (raw)

Choose a reason for hiding this comment

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

no problem.

I don't think we should avoid these blocks as too beneficial.

in a (hopefully not too distant) future PR, i'll be adding...

    if TYPE_CHECKING:  # attributes index and columns are created dynamically
        index = None  # type: Index
        columns = None  # type: Index

to frame.py so that i can get types for self.fmt.tr_frame.index.format and self.frame.index.nlevels etc.

in this case all tests pass without the if TYPE_CHECKING but would rather not change runtime behaviour if avoidable.