Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To fix Databrics UserWarning: DataFrame constructor is internal... #373

Merged
merged 1 commit into from
Jul 5, 2022

Conversation

navinrathore
Copy link
Contributor

Used SparkSession object instead. SqlContext is deprecated. Code link

@navinrathore navinrathore marked this pull request as draft July 1, 2022 07:18
@navinrathore
Copy link
Contributor Author

Regarding replacing toPandas(), this funciton gives following error

  File "/home/navin/workDir/zingg-1/python/zingg/zingg.py", line 58, in getPandasDfFromDs
    return self.getDfFromDs(data).toPandas()
  File "/home/navin/softlibs/spark-3.1.2-bin-hadoop2.7/python/lib/pyspark.zip/pyspark/sql/pandas/conversion.py", line 67, in toPandas
AttributeError: 'SparkSession' object has no attribute '_conf'

As pyspark is built from JVM bsed Dataframe. [internally many JVM apis are called on it], seems there is limitations such as missing toPandas().
Therefore, used pd.DataFrame() to build pandas dataframe.

  • Needless to say pandas dataframe are meant only for small sets of records

@navinrathore navinrathore mentioned this pull request Jul 1, 2022
@navinrathore
Copy link
Contributor Author

@sonalgoyal sonalgoyal marked this pull request as ready for review July 5, 2022 01:30
@sonalgoyal sonalgoyal merged commit a5a3195 into zinggAI:main Jul 5, 2022
@navinrathore navinrathore deleted the PythonAPI branch July 28, 2022 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants