Skip to content

Commit 8baae0c

Browse files
committed
Fixed regression and made consistent use of create_rf_spark_session
1 parent d3eccb4 commit 8baae0c

File tree

10 files changed

+19
-9
lines changed

10 files changed

+19
-9
lines changed

docs/src/main/paradox/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### 0.8.3
66

77
* Updated `rf_crs` to accept string columns containing CRS specifications. ([#366](https://github.com/locationtech/rasterframes/issues/366))
8+
* _Breaking_ (potentially): removed `pyrasterframes.create_spark_session` in lieu of `pyrasterframes.utils.create_rf_spark_session`
89

910
### 0.8.2
1011

pyrasterframes/src/main/python/docs/description.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
```python, setup, echo=False
44
import pyrasterframes
5+
from pyrasterframes.utils import create_rf_spark_session
56
import pyrasterframes.rf_ipython
67
from pyrasterframes.rasterfunctions import rf_crs, rf_extent, rf_tile, rf_data_cells
78
from pyspark.sql.functions import col, lit
8-
spark = pyrasterframes.get_spark_session()
9+
spark = create_rf_spark_session()
910

1011
# Note that this is the same URI as in the getting started page...
1112
df = spark.read.raster('https://modis-pds.s3.amazonaws.com/MCD43A4.006/11/08/2019059/MCD43A4.A2019059.h11v08.006.2019072203257_B02.TIF')

pyrasterframes/src/main/python/docs/getting-started.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ from pyrasterframes import rf_ipython
2929

3030
```python, version
3131
import pyrasterframes
32-
spark = pyrasterframes.get_spark_session()
32+
from pyrasterframes.utils import create_rf_spark_session
33+
spark = create_rf_spark_session()
3334
```
3435

3536
Then, you can read a raster and work with it in a Spark DataFrame.

pyrasterframes/src/main/python/docs/nodata-handling.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ To understand how NoData is handled in RasterFrames, we first need to understand
1212

1313
```python setup, echo=False
1414
import pyrasterframes
15+
from pyrasterframes.utils import create_rf_spark_session
1516
from pyrasterframes.rasterfunctions import *
1617
import pyrasterframes.rf_ipython
1718
from IPython.display import display
1819
import pandas as pd
1920
import numpy as np
2021
from pyrasterframes.rf_types import Tile
2122

22-
spark = pyrasterframes.get_spark_session()
23+
spark = create_rf_spark_session()
2324
```
2425

2526
The `CellType` class from the `rf_types` submodule allows us to create a representation of any valid cell type. There are convenience methods to create instances for a variety of basic types.

pyrasterframes/src/main/python/docs/numpy-pandas.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ As discussed in the @ref:[raster writing chapter](raster-write.md#dataframe-samp
3434

3535
```python, spark_session, echo=False
3636
import pyrasterframes
37+
from pyrasterframes.utils import create_rf_spark_session
3738
from pyrasterframes.rasterfunctions import *
3839
from IPython.display import display
39-
spark = pyrasterframes.get_spark_session()
40+
spark = create_rf_spark_session()
4041

4142
```
4243

pyrasterframes/src/main/python/docs/raster-write.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ However, there are times in any analysis where writing a representative sample o
66

77
```python imports, echo=False
88
import pyrasterframes
9+
from pyrasterframes.utils import create_rf_spark_session
910
from pyrasterframes.rasterfunctions import *
1011
from IPython.display import display
1112
import os.path
1213

13-
spark = pyrasterframes.get_spark_session()
14+
spark = create_rf_spark_session()
1415
```
1516

1617
## Tile Samples

pyrasterframes/src/main/python/docs/reference.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ For the Scala documentation on these functions, see @scaladoc[`RasterFunctions`]
1212

1313
```python imports, echo=False
1414
import pyrasterframes
15+
from pyrasterframes.utils import create_rf_spark_session
1516
from pyrasterframes.rasterfunctions import *
1617
from IPython.display import display
1718
import os.path
1819

19-
spark = pyrasterframes.get_spark_session()
20+
spark = create_rf_spark_session()
2021
```
2122

2223
## List of Available SQL and Python Functions

pyrasterframes/src/main/python/docs/time-series.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@
66
from IPython.display import display
77

88
import pyrasterframes
9+
from pyrasterframes.utils import create_rf_spark_session
910
from pyrasterframes.rasterfunctions import *
1011
import pyrasterframes.rf_ipython
1112

1213
from pyspark.sql.functions import udf, lit
1314
from geomesa_pyspark.types import MultiPolygonUDT
1415

1516
# This job is more memory bound, so reduce the concurrent tasks.
16-
spark = pyrasterframes.get_spark_session("local[4]")
17+
spark = create_rf_spark_session("local[4]")
1718
```
1819

1920
In this example, we will show how the flexibility of the DataFrame concept for raster data allows a simple and intuitive way to extract a time series from Earth observation data. We will continue our example from the @ref:[Zonal Map Algebra page](zonal-algebra.md).

pyrasterframes/src/main/python/docs/vector-data.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ RasterFrames provides a variety of ways to work with spatial vector data (points
1010

1111
```python, setup, echo=False
1212
import pyrasterframes
13+
from pyrasterframes.utils import create_rf_spark_session
1314
import pyrasterframes.rf_ipython
1415
import geopandas
1516
import folium
16-
spark = pyrasterframes.get_spark_session('local[2]')
17+
spark = create_rf_spark_session('local[2]')
1718
```
1819

1920
## GeoJSON DataSource

pyrasterframes/src/main/python/docs/zonal-algebra.pymd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
from IPython.display import display
55

66
import pyrasterframes
7+
from pyrasterframes.utils import create_rf_spark_session
78
from pyrasterframes.rasterfunctions import *
89
import pyrasterframes.rf_ipython
910

1011
from pyspark.sql.functions import udf, lit
1112
from geomesa_pyspark.types import MultiPolygonUDT
1213

1314
# This seemed to work for time-series!
14-
spark = pyrasterframes.get_spark_session("local[4]")
15+
spark = create_rf_spark_session("local[4]")
1516
```
1617

1718
## Definition

0 commit comments

Comments
 (0)