Skip to content

Commit 44f321a

Browse files
author
Matt Roeschke
committed
clean up merge
1 parent 7bdf6f3 commit 44f321a

File tree

2 files changed

+31
-38
lines changed

2 files changed

+31
-38
lines changed

doc/source/io.rst

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4959,7 +4959,36 @@ default ``Text`` type for string columns:
49594959
Because of this, reading the database table back in does **not** generate
49604960
a categorical.
49614961

4962-
<<<<<<< HEAD
4962+
.. _io.sql_datetime_data:
4963+
4964+
Datetime data types
4965+
'''''''''''''''''''
4966+
4967+
Using SQLAlchemy, :func:`~pandas.DataFrame.to_sql` is capable of writing
4968+
datetime data that is timezone naive or timezone aware. However, the resulting
4969+
data stored in the database ultimately depends on the supported data type
4970+
for datetime data of the database system being used.
4971+
4972+
The following table lists supported data types for datetime data for some
4973+
common databases. Other database dialects may have different data types for
4974+
datetime data.
4975+
4976+
=========== ============================================= ===================
4977+
Database SQL Datetime Types Timezone Support
4978+
=========== ============================================= ===================
4979+
SQLite ``TEXT`` No
4980+
MySQL ``TIMESTAMP`` or ``DATETIME`` No
4981+
PostgreSQL ``TIMESTAMP`` or ``TIMESTAMP WITH TIME ZONE`` Yes
4982+
=========== ============================================= ===================
4983+
4984+
When writing timezone aware data to databases that do not support timezones,
4985+
the data will be written as timezone naive timestamps that are in local time
4986+
with respect to the timezone.
4987+
4988+
:func:`~pandas.read_sql_table` is also capable of reading datetime data that is
4989+
timezone aware or naive. When reading ``TIMESTAMP WITH TIME ZONE`` types, pandas
4990+
will convert the data to UTC.
4991+
49634992
.. _io.sql.method:
49644993

49654994
Insertion Method
@@ -5008,38 +5037,6 @@ Example of a callable using PostgreSQL `COPY clause
50085037
table_name, columns)
50095038
cur.copy_expert(sql=sql, file=s_buf)
50105039

5011-
=======
5012-
.. _io.sql_datetime_data:
5013-
5014-
Datetime data types
5015-
'''''''''''''''''''
5016-
5017-
Using SQLAlchemy, :func:`~pandas.DataFrame.to_sql` is capable of writing
5018-
datetime data that is timezone naive or timezone aware. However, the resulting
5019-
data stored in the database ultimately depends on the supported data type
5020-
for datetime data of the database system being used.
5021-
5022-
The following table lists supported data types for datetime data for some
5023-
common databases. Other database dialects may have different data types for
5024-
datetime data.
5025-
5026-
=========== ============================================= ===================
5027-
Database SQL Datetime Types Timezone Support
5028-
=========== ============================================= ===================
5029-
SQLite ``TEXT`` No
5030-
MySQL ``TIMESTAMP`` or ``DATETIME`` No
5031-
PostgreSQL ``TIMESTAMP`` or ``TIMESTAMP WITH TIME ZONE`` Yes
5032-
=========== ============================================= ===================
5033-
5034-
When writing timezone aware data to databases that do not support timezones,
5035-
the data will be written as timezone naive timestamps that are in local time
5036-
with respect to the timezone.
5037-
5038-
:func:`~pandas.read_sql_table` is also capable of reading datetime data that is
5039-
timezone aware or naive. When reading ``TIMESTAMP WITH TIME ZONE`` types, pandas
5040-
will convert the data to UTC.
5041-
>>>>>>> upstream/master
5042-
50435040
Reading Tables
50445041
''''''''''''''
50455042

doc/source/whatsnew/v0.24.0.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,7 @@ Other Enhancements
331331

332332
- :func:`to_datetime` now supports the ``%Z`` and ``%z`` directive when passed into ``format`` (:issue:`13486`)
333333
- :func:`Series.mode` and :func:`DataFrame.mode` now support the ``dropna`` parameter which can be used to specify whether ``NaN``/``NaT`` values should be considered (:issue:`17534`)
334-
<<<<<<< HEAD:doc/source/whatsnew/v0.24.0.txt
335-
- :func:`to_csv` now supports ``compression`` keyword when a file handle is passed. (:issue:`21227`)
336-
- :func:`~pandas.DataFrame.to_sql` add parameter ``method`` to control SQL insertion clause (:8953:)
337-
=======
338334
- :func:`DataFrame.to_csv` and :func:`Series.to_csv` now support the ``compression`` keyword when a file handle is passed. (:issue:`21227`)
339-
>>>>>>> upstream/master:doc/source/whatsnew/v0.24.0.rst
340335
- :meth:`Index.droplevel` is now implemented also for flat indexes, for compatibility with :class:`MultiIndex` (:issue:`21115`)
341336
- :meth:`Series.droplevel` and :meth:`DataFrame.droplevel` are now implemented (:issue:`20342`)
342337
- Added support for reading from/writing to Google Cloud Storage via the ``gcsfs`` library (:issue:`19454`, :issue:`23094`)
@@ -378,6 +373,7 @@ Other Enhancements
378373
- :meth:`DataFrame.between_time` and :meth:`DataFrame.at_time` have gained the an ``axis`` parameter (:issue:`8839`)
379374
- The ``scatter_matrix``, ``andrews_curves``, ``parallel_coordinates``, ``lag_plot``, ``autocorrelation_plot``, ``bootstrap_plot``, and ``radviz`` plots from the ``pandas.plotting`` module are now accessible from calling :meth:`DataFrame.plot` (:issue:`11978`)
380375
- :class:`IntervalIndex` has gained the :attr:`~IntervalIndex.is_overlapping` attribute to indicate if the ``IntervalIndex`` contains any overlapping intervals (:issue:`23309`)
376+
- :func:`pandas.DataFrame.to_sql` has gained the ``method`` argument to control SQL insertion clause (:issue:`8953`)
381377

382378
.. _whatsnew_0240.api_breaking:
383379

0 commit comments

Comments
 (0)