Skip to content

Commit

Permalink
fixed python enable_gdal
Browse files Browse the repository at this point in the history
  • Loading branch information
sllynn committed Oct 12, 2023
1 parent 35526c0 commit 509cf31
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions python/mosaic/api/gdal.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
def setup_gdal(
spark: SparkSession,
init_script_path: str = "/dbfs/FileStore/geospatial/mosaic/gdal/",
shared_objects_path: str = "/dbfs/FileStore/geospatial/mosaic/gdal/",
) -> None:
"""
Prepare GDAL init script and shared objects required for GDAL to run on spark.
Expand All @@ -21,9 +20,6 @@ def setup_gdal(
The active SparkSession.
init_script_path : str
Path to write out the init script for GDAL installation.
shared_objects_path : str
Path to write out shared objects (libgdalalljni.so and libgdalalljni.so.30) that GDAL requires at runtime.
Note: If you dont use the default path you will need to update the generated init script.
Returns
-------
Expand All @@ -34,9 +30,7 @@ def setup_gdal(
sc._jvm.com.databricks.labs.mosaic.functions, "MosaicContext"
)
mosaicGDALObject = getattr(sc._jvm.com.databricks.labs.mosaic.gdal, "MosaicGDAL")
mosaicGDALObject.prepareEnvironment(
spark._jsparkSession, init_script_path, shared_objects_path
)
mosaicGDALObject.prepareEnvironment(spark._jsparkSession, init_script_path)
print("GDAL setup complete.\n")
print(f"Shared objects (*.so) stored in: {shared_objects_path}.\n")
print(f"Init script stored in: {init_script_path}.\n")
Expand Down
2 changes: 1 addition & 1 deletion python/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ packages = find:
python_requires = >=3.7.0
install_requires =
keplergl==0.3.2
h3==3.7.0
h3==3.7.3
ipython>=7.22.0

[options.package_data]
Expand Down

0 comments on commit 509cf31

Please sign in to comment.