Github user Stibbons commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14918#discussion_r77174714
  
    --- Diff: python/pyspark/sql/session.py ---
    @@ -396,14 +398,18 @@ def _createFromLocal(self, data, schema):
                 raise TypeError("schema should be StructType or list or None, 
but got: %s" % schema)
     
             # convert python objects to sql data
    -        data = [schema.toInternal(row) for row in data]
    +        if prepareFunc is not None:
    +            data = [schema.toInternal(prepareFunc(row)) for row in data]
    +        else:
    +            data = [schema.toInternal(row) for row in data]
    --- End diff --
    
    in this case we avoided the call to ```map(prepare, data)``` when prepare 
is the identity function


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to