@@ -31,18 +31,28 @@ def tables_formatted(dataset = @dataset)
3131 tables ( dataset ) . map { |t | t [ 'tableReference' ] [ 'tableId' ] }
3232 end
3333
34- # Returns all rows of table data
34+ # Returns entire response of table data
3535 #
3636 # @param tableId [String] id of the table to look for
3737 # @param dataset [String] dataset to look for
3838 # @param options [Hash] hash of optional query parameters (maxResults, startIndex)
3939 # @return [Hash] json api response
40- def table_data ( tableId , dataset = @dataset , options = { } )
40+ def table_raw_data ( tableId , dataset = @dataset , options = { } )
4141 parameters = { 'datasetId' => dataset , 'tableId' => tableId }
4242 parameters [ 'maxResults' ] = options [ :maxResults ] if options [ :maxResults ]
4343 parameters [ 'startIndex' ] = options [ :startIndex ] if options [ :startIndex ]
44- response = api ( api_method : @bq . tabledata . list ,
44+ api ( api_method : @bq . tabledata . list ,
4545 parameters : parameters )
46+ end
47+
48+ # Returns all rows of table data
49+ #
50+ # @param tableId [String] id of the table to look for
51+ # @param dataset [String] dataset to look for
52+ # @param options [Hash] hash of optional query parameters (maxResults, startIndex)
53+ # @return [Hash] json api response
54+ def table_data ( tableId , dataset = @dataset , options = { } )
55+ response = table_raw_data ( tableId , dataset , options )
4656 response [ 'rows' ] || [ ]
4757 end
4858
0 commit comments