You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/03/23 13:33:25 UTC
[GitHub] [airflow] feluelle commented on a change in pull request #4829:
[AIRFLOW-3993] Change SalesforceHook and add tests
feluelle commented on a change in pull request #4829: [AIRFLOW-3993] Change SalesforceHook and add tests
URL: https://github.com/apache/airflow/pull/4829#discussion_r268394883
##########
File path: airflow/contrib/hooks/salesforce_hook.py
##########
@@ -303,18 +281,12 @@ def write_object_to_file(
# (as is fairly standard for JavaScript)
# And for csv, we do a string
if fmt == "csv":
- # there are also a ton of newline objects
- # that mess up our ability to write to csv
+ # there are also a ton of newline objects that mess up our ability to write to csv
# we remove these newlines so that the output is a valid CSV format
self.log.info("Cleaning data and writing to CSV")
possible_strings = df.columns[df.dtypes == "object"]
- df[possible_strings] = df[possible_strings].apply(
- lambda x: x.str.replace("\r\n", "")
- )
- df[possible_strings] = df[possible_strings].apply(
- lambda x: x.str.replace("\n", "")
- )
-
+ df[possible_strings] = df[possible_strings].apply(lambda x: x.str.replace("\r\n", ""))
+ df[possible_strings] = df[possible_strings].apply(lambda x: x.str.replace("\n", ""))
Review comment:
Yes, thanks for pointing that out. 👍
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services