zhongjiajie commented on a change in pull request #4829: [AIRFLOW-3993] Change 
SalesforceHook and add tests
URL: https://github.com/apache/airflow/pull/4829#discussion_r268390536
 
 

 ##########
 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:
   Could we use single line to remove rather than L288-L289?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to