28
28
from google .cloud .bigquery .job .base import _AsyncJob
29
29
from google .cloud .bigquery .job .base import _JobConfig
30
30
from google .cloud .bigquery .job .base import _JobReference
31
+ from google .cloud .bigquery .query import ConnectionProperty
31
32
32
33
33
34
class LoadJobConfig (_JobConfig ):
@@ -120,6 +121,25 @@ def clustering_fields(self, value):
120
121
else :
121
122
self ._del_sub_prop ("clustering" )
122
123
124
+ @property
125
+ def connection_properties (self ) -> List [ConnectionProperty ]:
126
+ """Connection properties.
127
+
128
+ See
129
+ https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationLoad.FIELDS.connection_properties
130
+
131
+ .. versionadded:: 3.7.0
132
+ """
133
+ resource = self ._get_sub_prop ("connectionProperties" , [])
134
+ return [ConnectionProperty .from_api_repr (prop ) for prop in resource ]
135
+
136
+ @connection_properties .setter
137
+ def connection_properties (self , value : Iterable [ConnectionProperty ]):
138
+ self ._set_sub_prop (
139
+ "connectionProperties" ,
140
+ [prop .to_api_repr () for prop in value ],
141
+ )
142
+
123
143
@property
124
144
def create_disposition (self ):
125
145
"""Optional[google.cloud.bigquery.job.CreateDisposition]: Specifies behavior
@@ -134,6 +154,27 @@ def create_disposition(self):
134
154
def create_disposition (self , value ):
135
155
self ._set_sub_prop ("createDisposition" , value )
136
156
157
+ @property
158
+ def create_session (self ) -> Optional [bool ]:
159
+ """[Preview] If :data:`True`, creates a new session, where
160
+ :attr:`~google.cloud.bigquery.job.LoadJob.session_info` will contain a
161
+ random server generated session id.
162
+
163
+ If :data:`False`, runs load job with an existing ``session_id`` passed in
164
+ :attr:`~google.cloud.bigquery.job.LoadJobConfig.connection_properties`,
165
+ otherwise runs load job in non-session mode.
166
+
167
+ See
168
+ https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#JobConfigurationLoad.FIELDS.create_session
169
+
170
+ .. versionadded:: 3.7.0
171
+ """
172
+ return self ._get_sub_prop ("createSession" )
173
+
174
+ @create_session .setter
175
+ def create_session (self , value : Optional [bool ]):
176
+ self ._set_sub_prop ("createSession" , value )
177
+
137
178
@property
138
179
def decimal_target_types (self ) -> Optional [FrozenSet [str ]]:
139
180
"""Possible SQL data types to which the source decimal values are converted.
@@ -629,13 +670,31 @@ def autodetect(self):
629
670
"""
630
671
return self ._configuration .autodetect
631
672
673
+ @property
674
+ def connection_properties (self ) -> List [ConnectionProperty ]:
675
+ """See
676
+ :attr:`google.cloud.bigquery.job.LoadJobConfig.connection_properties`.
677
+
678
+ .. versionadded:: 3.7.0
679
+ """
680
+ return self ._configuration .connection_properties
681
+
632
682
@property
633
683
def create_disposition (self ):
634
684
"""See
635
685
:attr:`google.cloud.bigquery.job.LoadJobConfig.create_disposition`.
636
686
"""
637
687
return self ._configuration .create_disposition
638
688
689
+ @property
690
+ def create_session (self ) -> Optional [bool ]:
691
+ """See
692
+ :attr:`google.cloud.bigquery.job.LoadJobConfig.create_session`.
693
+
694
+ .. versionadded:: 3.7.0
695
+ """
696
+ return self ._configuration .create_session
697
+
639
698
@property
640
699
def encoding (self ):
641
700
"""See
0 commit comments