2828from google .cloud .bigquery .job .base import _AsyncJob
2929from google .cloud .bigquery .job .base import _JobConfig
3030from google .cloud .bigquery .job .base import _JobReference
31+ from google .cloud .bigquery .query import ConnectionProperty
3132
3233
3334class LoadJobConfig (_JobConfig ):
@@ -120,6 +121,25 @@ def clustering_fields(self, value):
120121 else :
121122 self ._del_sub_prop ("clustering" )
122123
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+
123143 @property
124144 def create_disposition (self ):
125145 """Optional[google.cloud.bigquery.job.CreateDisposition]: Specifies behavior
@@ -134,6 +154,27 @@ def create_disposition(self):
134154 def create_disposition (self , value ):
135155 self ._set_sub_prop ("createDisposition" , value )
136156
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+
137178 @property
138179 def decimal_target_types (self ) -> Optional [FrozenSet [str ]]:
139180 """Possible SQL data types to which the source decimal values are converted.
@@ -629,13 +670,31 @@ def autodetect(self):
629670 """
630671 return self ._configuration .autodetect
631672
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+
632682 @property
633683 def create_disposition (self ):
634684 """See
635685 :attr:`google.cloud.bigquery.job.LoadJobConfig.create_disposition`.
636686 """
637687 return self ._configuration .create_disposition
638688
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+
639698 @property
640699 def encoding (self ):
641700 """See
0 commit comments