Closed ljvmiranda921 closed 5 years ago
We can use https://www.gaia-gis.it/fossil/libspatialite/index to test SQL queries without querying BQ directly
I can take a look at this this weekend! So main idea is to create test fixtures from a SQLite DB
Some notes:
source
test database by loading Philippine shapefiles from Geofrabrik. Check this tutorial. Although I don't think we'll need the whole thing, especially if we're going to commit
this? Maybe just get via wget
insteadtest
database of pointsAsText
CSV
with WKT
columns into the dbimport sqlite3
conn = sqlite3.connect('test_source.sqlite')
conn.enable_load_extension(True)
try:
conn.load_extension('mod_spatialite.so')
except OperationalError:
conn.load_extension('libspatialite.so')
cursor = conn.cursor()
cursor.execute(QUERY)
More info on mod_spatialite.so
The main challenge here is to mock the bigquery client. Still not sure how this will all work, but we should have atleast good test coverage for this project.