google-cloud-bigquery 1.54.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +24 -0
- data/lib/google/cloud/bigquery/condition.rb +218 -0
- data/lib/google/cloud/bigquery/dataset/access.rb +281 -28
- data/lib/google/cloud/bigquery/dataset.rb +9 -3
- data/lib/google/cloud/bigquery/external/csv_source.rb +47 -0
- data/lib/google/cloud/bigquery/external/data_source.rb +78 -30
- data/lib/google/cloud/bigquery/load_job.rb +72 -24
- data/lib/google/cloud/bigquery/project.rb +117 -13
- data/lib/google/cloud/bigquery/remote_function_options.rb +156 -0
- data/lib/google/cloud/bigquery/routine.rb +76 -0
- data/lib/google/cloud/bigquery/service.rb +9 -8
- data/lib/google/cloud/bigquery/table.rb +104 -10
- data/lib/google/cloud/bigquery/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7eb6ceb935eefe0881476f99a5f6e7bdf85e42debb251ba34ef999a3845ca3ef
|
|
4
|
+
data.tar.gz: 71cb8fa56300a051b257e77fb332fee37a18044fb26317a3e0eebbb57023144d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70305f4088f9af6ad6823f07e9326a5db55e2abfd17094d4a3d52ae1dd85dae871df5acaec43b9163130f7cbe226a3339dbcef96bbf181fdbafcbbdfca70bcb8
|
|
7
|
+
data.tar.gz: 93f2a24709c74dae96f6732ee36d328f9f46e9cecb63f87ac1da70d9e37d1a4d03c452ae4c4a772b31adb5145cb53157f4d14869d54f0131208ac2060551cb19
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Release History
|
|
2
2
|
|
|
3
|
+
### 1.58.0 (2025-09-03)
|
|
4
|
+
|
|
5
|
+
#### Features
|
|
6
|
+
|
|
7
|
+
* Add support for remote function options ([#30822](https://github.com/googleapis/google-cloud-ruby/issues/30822))
|
|
8
|
+
|
|
9
|
+
### 1.57.0 (2025-08-28)
|
|
10
|
+
|
|
11
|
+
#### Features
|
|
12
|
+
|
|
13
|
+
* Add support for reference_file_schema_uri for LoadJobConfig and ExternalDataSource ([#30859](https://github.com/googleapis/google-cloud-ruby/issues/30859))
|
|
14
|
+
|
|
15
|
+
### 1.56.0 (2025-08-27)
|
|
16
|
+
|
|
17
|
+
#### Features
|
|
18
|
+
|
|
19
|
+
* Add support for preserve_ascii_control_characters in CSVOptions and LoadJobConfiguration ([#30857](https://github.com/googleapis/google-cloud-ruby/issues/30857))
|
|
20
|
+
|
|
21
|
+
### 1.55.0 (2025-08-26)
|
|
22
|
+
|
|
23
|
+
#### Features
|
|
24
|
+
|
|
25
|
+
* Add support for IAM Condition in Dataset Access ([#30854](https://github.com/googleapis/google-cloud-ruby/issues/30854))
|
|
26
|
+
|
|
3
27
|
### 1.54.0 (2025-08-15)
|
|
4
28
|
|
|
5
29
|
#### Features
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Copyright 2025 Google LLC
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
require "google/apis/bigquery_v2"
|
|
16
|
+
|
|
17
|
+
module Google
|
|
18
|
+
module Cloud
|
|
19
|
+
module Bigquery
|
|
20
|
+
##
|
|
21
|
+
# # Condition
|
|
22
|
+
#
|
|
23
|
+
# Represents a textual expression in the Common Expression Language (CEL) syntax.
|
|
24
|
+
# CEL is a C-like expression language. The syntax and semantics of CEL are documented
|
|
25
|
+
# at https://github.com/google/cel-spec
|
|
26
|
+
#
|
|
27
|
+
# Used to define condition for {Dataset::Access} rules
|
|
28
|
+
#
|
|
29
|
+
class Condition
|
|
30
|
+
##
|
|
31
|
+
# Returns the textual representation of an expression in Common Expression Language syntax.
|
|
32
|
+
#
|
|
33
|
+
# @return [String] The expression of the condition.
|
|
34
|
+
#
|
|
35
|
+
# @example
|
|
36
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
37
|
+
# "resource.name.startsWith('projects/my-project')"
|
|
38
|
+
# )
|
|
39
|
+
# puts condition.expression # => "resource.name.startsWith('projects/my-project')"
|
|
40
|
+
#
|
|
41
|
+
def expression
|
|
42
|
+
@expression
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
##
|
|
46
|
+
# Sets the textual representation of an expression in Common Expression Language syntax.
|
|
47
|
+
#
|
|
48
|
+
# @param [String] val The expression to set.
|
|
49
|
+
#
|
|
50
|
+
# @raise [ArgumentError] if the expression is nil or empty.
|
|
51
|
+
#
|
|
52
|
+
# @example
|
|
53
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
54
|
+
# "resource.name.startsWith('projects/my-project')"
|
|
55
|
+
# )
|
|
56
|
+
# condition.expression = "document.summary.size() < 100"
|
|
57
|
+
#
|
|
58
|
+
def expression= val
|
|
59
|
+
if val.nil? || val.strip.empty?
|
|
60
|
+
raise ArgumentError, "Expression cannot be nil or empty"
|
|
61
|
+
end
|
|
62
|
+
@expression = val
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
##
|
|
66
|
+
# Returns the optional description of the expression. This is a longer text which describes
|
|
67
|
+
# the expression, e.g. when hovered over it in a UI.
|
|
68
|
+
#
|
|
69
|
+
# @return [String, nil] The description of the condition. nil if not set.
|
|
70
|
+
#
|
|
71
|
+
# @example
|
|
72
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
73
|
+
# "document.summary.size() < 100",
|
|
74
|
+
# description: "Checks if summary is less than 100 chars"
|
|
75
|
+
# )
|
|
76
|
+
# puts condition.description # => "Checks if summary is less than 100 chars"
|
|
77
|
+
#
|
|
78
|
+
def description
|
|
79
|
+
@description
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
##
|
|
83
|
+
# Sets the optional description of the expression. This is a longer text which describes
|
|
84
|
+
# the expression, e.g. when hovered over it in a UI.
|
|
85
|
+
#
|
|
86
|
+
# @param [String, nil] val The description to set. nil to unset.
|
|
87
|
+
#
|
|
88
|
+
# @example
|
|
89
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
90
|
+
# "document.summary.size() < 100"
|
|
91
|
+
# )
|
|
92
|
+
# condition.description = "Checks if summary is less than 100 chars"
|
|
93
|
+
#
|
|
94
|
+
def description= val
|
|
95
|
+
@description = val
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
##
|
|
99
|
+
# Returns the optional string indicating the location of the expression for error reporting,
|
|
100
|
+
# e.g. a file name and a position in the file.
|
|
101
|
+
#
|
|
102
|
+
# @return [String, nil] The location of the condition. nil if not set.
|
|
103
|
+
#
|
|
104
|
+
# @example
|
|
105
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
106
|
+
# "document.summary.size() < 100",
|
|
107
|
+
# location: "document/summary"
|
|
108
|
+
# )
|
|
109
|
+
# puts condition.location # => "document/summary"
|
|
110
|
+
#
|
|
111
|
+
def location
|
|
112
|
+
@location
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
##
|
|
116
|
+
# Sets the optional string indicating the location of the expression for error reporting,
|
|
117
|
+
# e.g. a file name and a position in the file.
|
|
118
|
+
#
|
|
119
|
+
# @param [String, nil] val The location to set. nil to unset.
|
|
120
|
+
#
|
|
121
|
+
# @example
|
|
122
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
123
|
+
# "document.summary.size() < 100"
|
|
124
|
+
# )
|
|
125
|
+
# condition.location = "document/summary"
|
|
126
|
+
#
|
|
127
|
+
def location= val
|
|
128
|
+
@location = val
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
##
|
|
132
|
+
# Returns the optional title for the expression, i.e. a short string describing its purpose.
|
|
133
|
+
# This can be used e.g. in UIs which allow to enter the expression.
|
|
134
|
+
#
|
|
135
|
+
# @return [String, nil] The title of the condition. nil if not set.
|
|
136
|
+
#
|
|
137
|
+
# @example
|
|
138
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
139
|
+
# "document.summary.size() < 100",
|
|
140
|
+
# title: "Summary size limit"
|
|
141
|
+
# )
|
|
142
|
+
# puts condition.title # => "Summary size limit"
|
|
143
|
+
#
|
|
144
|
+
def title
|
|
145
|
+
@title
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
##
|
|
149
|
+
# Sets the optional title for the expression, i.e. a short string describing its purpose.
|
|
150
|
+
# This can be used e.g. in UIs which allow to enter the expression.
|
|
151
|
+
#
|
|
152
|
+
# @param [String, nil] val The title to set. nil to unset.
|
|
153
|
+
#
|
|
154
|
+
# @example
|
|
155
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
156
|
+
# "document.summary.size() < 100"
|
|
157
|
+
# )
|
|
158
|
+
# condition.title = "Summary size limit"
|
|
159
|
+
#
|
|
160
|
+
def title= val
|
|
161
|
+
@title = val
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
##
|
|
165
|
+
# Create a new Condition object.
|
|
166
|
+
#
|
|
167
|
+
# @param [String] expression The expression in CEL syntax.
|
|
168
|
+
# @param [String] description Optional description of the expression.
|
|
169
|
+
# @param [String] location Optional location of the expression for error reporting.
|
|
170
|
+
# @param [String] title Optional title for the expression.
|
|
171
|
+
#
|
|
172
|
+
# @raise [ArgumentError] if expression is nil or empty.
|
|
173
|
+
#
|
|
174
|
+
# @example
|
|
175
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
176
|
+
# "document.summary.size() < 100",
|
|
177
|
+
# description: "Determines if a summary is less than 100 chars",
|
|
178
|
+
# location: "document/summary",
|
|
179
|
+
# title: "Summary size limit"
|
|
180
|
+
# )
|
|
181
|
+
#
|
|
182
|
+
# @see https://cloud.google.com/bigquery/docs/reference/auditlogs/rest/Shared.Types/Expr
|
|
183
|
+
#
|
|
184
|
+
def initialize expression, description: nil, location: nil, title: nil
|
|
185
|
+
if expression.nil? || expression.strip.empty?
|
|
186
|
+
raise ArgumentError, "Expression cannot be nil or empty"
|
|
187
|
+
end
|
|
188
|
+
@expression = expression
|
|
189
|
+
@description = description
|
|
190
|
+
@location = location
|
|
191
|
+
@title = title
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
##
|
|
195
|
+
# @private Convert the Condition object to a Google API Client object.
|
|
196
|
+
#
|
|
197
|
+
# @return [Google::Apis::BigqueryV2::Expr] The Google API Client object representing the condition.
|
|
198
|
+
#
|
|
199
|
+
# @example
|
|
200
|
+
# condition = Google::Cloud::Bigquery::Condition.new(
|
|
201
|
+
# "resource.name.startsWith('projects/my-project')"
|
|
202
|
+
# )
|
|
203
|
+
# gapi_condition = condition.to_gapi
|
|
204
|
+
#
|
|
205
|
+
# @see https://cloud.google.com/bigquery/docs/reference/auditlogs/rest/Shared.Types/Expr
|
|
206
|
+
#
|
|
207
|
+
def to_gapi
|
|
208
|
+
gapi = Google::Apis::BigqueryV2::Expr.new
|
|
209
|
+
gapi.description = @description unless @description.nil?
|
|
210
|
+
gapi.expression = @expression
|
|
211
|
+
gapi.location = @location unless @location.nil?
|
|
212
|
+
gapi.title = @title unless @title.nil?
|
|
213
|
+
gapi
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|