great-tables
great-tables copied to clipboard
DateStyle and TimeStyle are not part of the public API
Hi, thanks for the great library!
I'm writing a wrapper function for gt.fmt_datetime, gt.fmt_date etc. but I need to import DateStyle and TimeStyle from great_tables._formats to type hint the function correctly.
Have you considered re-exporting these Literals so they are accessible from the public API? Happy to make the PR myself, as well as re-export any other type hints that are in the public API if you agree this should be done.
Thanks for bringing this up.
@machow and @rich-iannone, do you think we should consider exposing some literals to make it easier for users to adopt type hints?
In the meantime, this could be a good opportunity to reflect on how we might enhance our type hints. I understand that the linter struggles with interpreting our databackend logic, and ensuring smooth compatibility with mypy remains a significant challenge for us.
@jrycw @BenGale93 Sorry for the long delay in responding to this. I do think we should more publicly expose literal values (for all the advantages listed above).
@BenGale93 Would it work for DateStyle and TimeStyle to be exposed in a new great_tables.types module?
Sounds good to me