@@ -770,6 +770,26 @@ def test_kriging(self):
770
770
result = json .loads (expression .serialize ())
771
771
self .assertEqual (expect , result )
772
772
773
+ def test_load_big_query_table (self ):
774
+ table = 'bigquery-public-data.new_york_subway.stations'
775
+ geometry_column = 'geometry'
776
+ expect = make_expression_graph ({
777
+ 'arguments' : {
778
+ 'table' : {'constantValue' : table },
779
+ 'geometryColumn' : {'constantValue' : geometry_column },
780
+ },
781
+ 'functionName' : 'FeatureCollection.loadBigQueryTable' ,
782
+ })
783
+ expression = ee .FeatureCollection .loadBigQueryTable (table , geometry_column )
784
+ result = json .loads (expression .serialize ())
785
+ self .assertEqual (expect , result )
786
+
787
+ expression = ee .FeatureCollection .loadBigQueryTable (
788
+ table = table , geometryColumn = geometry_column
789
+ )
790
+ result = json .loads (expression .serialize ())
791
+ self .assertEqual (expect , result )
792
+
773
793
def test_make_array (self ):
774
794
properties = ['a' , 'b' ]
775
795
name = 'name string'
@@ -951,7 +971,32 @@ def test_remap(self):
951
971
self .assertEqual (expect , result )
952
972
953
973
expression = collection .remap (
954
- lookupIn = lookup_in , lookupOut = lookup_out , columnName = column_name
974
+ lookupIn = lookup_in , lookupOut = lookup_out , columnName = column_name )
975
+ result = json .loads (expression .serialize ())
976
+ self .assertEqual (expect , result )
977
+
978
+ def test_run_big_query (self ):
979
+ query = 'SELECT * FROM `bigquery-public-data.new_york_subway.stations`'
980
+ geometry_column = 'geometry'
981
+ max_bytes_billed = 1000
982
+ expect = make_expression_graph ({
983
+ 'arguments' : {
984
+ 'query' : {'constantValue' : query },
985
+ 'geometryColumn' : {'constantValue' : geometry_column },
986
+ 'maxBytesBilled' : {'constantValue' : max_bytes_billed },
987
+ },
988
+ 'functionName' : 'FeatureCollection.runBigQuery' ,
989
+ })
990
+ expression = ee .FeatureCollection .runBigQuery (
991
+ query , geometry_column , max_bytes_billed
992
+ )
993
+ result = json .loads (expression .serialize ())
994
+ self .assertEqual (expect , result )
995
+
996
+ expression = ee .FeatureCollection .runBigQuery (
997
+ query = query ,
998
+ geometryColumn = geometry_column ,
999
+ maxBytesBilled = max_bytes_billed ,
955
1000
)
956
1001
result = json .loads (expression .serialize ())
957
1002
self .assertEqual (expect , result )
0 commit comments