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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix Shapely import in GEOGRAPHY sample #431

Merged
merged 1 commit into from Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions samples/geography/insert_wkt.py
Expand Up @@ -16,7 +16,7 @@
def insert_wkt(override_values={}):
# [START bigquery_insert_geography_wkt]
from google.cloud import bigquery
import shapely
import shapely.geometry
import shapely.wkt

bigquery_client = bigquery.Client()
Expand All @@ -32,7 +32,9 @@ def insert_wkt(override_values={}):

# Use the Shapely library to generate WKT of a line from LAX to
# JFK airports. Alternatively, you may define WKT data directly.
my_geography = shapely.LineString([(-118.4085, 33.9416), (-73.7781, 40.6413)])
my_geography = shapely.geometry.LineString(
[(-118.4085, 33.9416), (-73.7781, 40.6413)]
)
rows = [
# Convert data into a WKT string.
{"geo": shapely.wkt.dumps(my_geography)},
Expand Down
6 changes: 3 additions & 3 deletions samples/geography/insert_wkt_test.py
Expand Up @@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from . import insert_geojson
from . import insert_wkt


def test_insert_geojson(table_id):
errors = insert_geojson.insert_geojson(override_values={"table_id": table_id})
def test_insert_wkt(table_id):
errors = insert_wkt.insert_wkt(override_values={"table_id": table_id})
assert not errors