Skip to content

Support DATE and DATETIME in MSSQLToGCSOperator#11540

Closed
QuinRiva wants to merge 1 commit intoapache:masterfrom
QuinRiva:mssql_to_gcs_fix
Closed

Support DATE and DATETIME in MSSQLToGCSOperator#11540
QuinRiva wants to merge 1 commit intoapache:masterfrom
QuinRiva:mssql_to_gcs_fix

Conversation

@QuinRiva
Copy link

@QuinRiva QuinRiva commented Oct 15, 2020

closes: #11370


JSON serialization thows errors if date/datetime fields are in the table. Converting those fields to strings before serialization solves this issue.

Additionally add the DATETIME (which is separate to timestamp) as a typemap for converting a field to bigquery. This has the unfortunate side-effect of converting DATE to DATETIME as the MSSQL DBAPI doesn't distinguish between DATE and DATETIME (both type 2).

@boring-cyborg boring-cyborg bot added the provider:google Google (including GCP) related issues label Oct 15, 2020
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 15, 2020

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, pylint and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Please add unit tests.

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Please add unit tests.

@kaxil
Copy link
Member

kaxil commented Nov 4, 2020

Can you please rebase your PR on latest Master since we have applied Black and PyUpgrade on Master.

It will help if your squash your commits into single commit first so that there are less conflicts.

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Dec 25, 2020
@potiuk
Copy link
Member

potiuk commented Dec 25, 2020

Is this something we should finish/merge @ashb/@kaxil ? it looks needed :)

@stale stale bot removed the stale Stale PRs per the .github/workflows/stale.yml policy file label Dec 25, 2020
@mik-laj mik-laj changed the title JSON serialization of dates fix Support DATE and DATETIME in MSSQLToGCSOperator Dec 31, 2020
@mik-laj
Copy link
Member

mik-laj commented Dec 31, 2020

@potiuk This is about integration with Google, so looks like we'll have to take care of it.

@github-actions
Copy link

github-actions bot commented Mar 1, 2021

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Stale PRs per the .github/workflows/stale.yml policy file label Mar 1, 2021
@github-actions github-actions bot closed this Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

provider:google Google (including GCP) related issues stale Stale PRs per the .github/workflows/stale.yml policy file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSSQLToGCSOperator fails: datetime is not JSON Serializable

5 participants