Comments (12)
Thanks for the report. This is “by design” in today’s world because there isnt a first class dtype in pandas for dates.
Your workaround is the suggested approach, though if you really want date and not date time in the extract it falls short. I think could use a keyword argument that allows you to explicitly store date time dtypes as dates - interested in trying a PR for that?
from pantab.
Thanks will, i'll make a PR.
from pantab.
I'm trying to make a PR for kwargs for casting datetime.date to pd.datetime. Can you grant me permission? Thanks
def frame_to_hyper(
df: pd.DataFrame,
database: Union[str, pathlib.Path],
*,
table: pantab_types.TableType,
table_mode: str = "w",
**kwargs: Union[str, list]
) -> None:
"""See api.rst for documentation"""
if 'date_column' in kwargs:
date_column = kwargs.get('date_column')
if isinstance(date_column, list):
for col in date_column:
df[col] = pd.to_datetime(df[col])
elif isinstance(date_column, str):
df[date_column] = pd.to_datetime(df[date_column])
from pantab.
from pantab.
So there is a discussion of adding this as a type upstream in pandas:
I think any work we do here would have to wait on that, so let's see if that gets traction
from pantab.
The date field seems to have stalled in pandas, can this be considered again?
We have a fair few dates in our project, and would love to use pantab for this.
from pantab.
@joshuataylor have you looked at hyperarrow? It is a similar tool but with arrow as a back end you get first class DATE support
https://hyperarrow.readthedocs.io/en/latest/
from pantab.
I didn't know that library existed, awesome work 😍 . Will give it a go.
from pantab.
Is this still open? Running into this issue right now using pandas.
TypeError: Invalid value "datetime.date(2023, 10, 5)" found (row 0 column 5)
from pantab.
@jstrauss18 your column dtype is likely object. If you want to write time stamps make sure you use a datetime dtype column. Pandas does not natively support plain DATE types (pyarrow does, but pantab currently does not leverage pyarrow types)
from pantab.
Not sure what to do. I'm using databricks delta sharing to load data frame and I don't name the columns.
from pantab.
Sorry I'm not familiar with databricks so can't give specific advice. You might want to try StackOverflow for something more tailored. Most I/O methods in pandas provide a parse_dates=
argument that you can use when inferencing is not correct, although there may be something more foundational to be fixed with your code
As a hack you could try df.iloc[:, 5] = pd.to_datetime(df.iloc[:, 5])
since the traceback says its the fifth column where you are having an issue. But beyond that I would try StackOverflow or a Databricks support forum
from pantab.
Related Issues (20)
- What's the best channel to ask questions? HOT 1
- frames_from_hyper not pulling when there's no data in the table. HOT 10
- Unable to read Hyper file with pantab HOT 9
- Parquet Writer Implementation Not in pypi.org? HOT 3
- Make able to save columns in uppercase/lowercase HOT 1
- Memory Error when dataframe is empty HOT 5
- Enhance support for multiple tables (publishing to tableau server) HOT 16
- OutOfBoundsDatetime Error HOT 5
- TypeError: Column "event_is_failure" has unsupported datatype BOOL with nullability Nullability.NULLABLE HOT 2
- Python 3.11 - pantab/src/pantab.c:6:10: fatal error: 'cffi.h' file not found HOT 11
- Add Support for Tableau NUMERIC types HOT 5
- pypi Project links seem to be incorrect HOT 4
- Column Ordering Not Preserved HOT 4
- TypeError: Cannot use .astype to convert from timezone-naive dtype to timezone-aware dtype. Use obj.tz_localize instead or series.dt.tz_localize instead HOT 3
- Broken UTC timestamp writing HOT 2
- Regarding Limitation with Pantab1.1.0 with Date Datatype HOT 8
- Add pre-commit
- AWS Glue -- NotImplementedError: HOT 4
- Use trusted publishing HOT 1
- RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xe .
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pantab.