4646io_types_r = (io .BytesIO , io .BufferedReader )
4747io_types_w = (io .BytesIO , io .BufferedWriter )
4848
49- FilePath = Union [ str , os .PathLike ]
50- FileObject = Union [ io .BufferedReader , io .BytesIO ]
51- PathOrFile = Union [ FilePath , FileObject ]
49+ FilePath = str | os .PathLike
50+ FileObject = io .BufferedReader | io .BytesIO
51+ PathOrFile = FilePath | FileObject
5252
53- FileObjectR = Union [ io .BufferedReader , io .BytesIO ]
54- FileObjectW = Union [ io .BufferedWriter , io .BytesIO ]
55- PathOrFileR = Union [ FilePath , FileObjectR ]
56- PathOrFileW = Union [ FilePath , FileObjectW ]
53+ FileObjectR = io .BufferedReader | io .BytesIO
54+ FileObjectW = io .BufferedWriter | io .BytesIO
55+ PathOrFileR = FilePath | FileObjectR
56+ PathOrFileW = FilePath | FileObjectW
5757
5858
5959HyperActionCondition = TypedDict (
9191 },
9292)
9393
94- HyperAction = Union [ HyperActionTable , HyperActionRow ]
94+ HyperAction = HyperActionTable | HyperActionRow
9595
9696
9797class Datasources (QuerysetEndpoint [DatasourceItem ], TaggingMixin [DatasourceItem ]):
@@ -430,7 +430,7 @@ def update_connections(
430430 return connection_items
431431
432432 @api (version = "2.8" )
433- def refresh (self , datasource_item : Union [ DatasourceItem , str ] , incremental : bool = False ) -> JobItem :
433+ def refresh (self , datasource_item : DatasourceItem | str , incremental : bool = False ) -> JobItem :
434434 """
435435 Refreshes the extract of an existing workbook.
436436
@@ -542,47 +542,47 @@ def publish(
542542 as_job = False ,
543543 ):
544544 """
545- Publishes a data source to a server, or appends data to an existing
546- data source.
545+ Publishes a data source to a server, or appends data to an existing
546+ data source.
547547
548- This method checks the size of the data source and automatically
549- determines whether the publish the data source in multiple parts or in
550- one operation.
548+ This method checks the size of the data source and automatically
549+ determines whether the publish the data source in multiple parts or in
550+ one operation.
551551
552- REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#publish_data_source
552+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#publish_data_source
553553
554- Parameters
555- ----------
556- datasource_item : DatasourceItem
557- The datasource item to publish. The fields for name and project_id
558- are required.
554+ Parameters
555+ ----------
556+ datasource_item : DatasourceItem
557+ The datasource item to publish. The fields for name and project_id
558+ are required.
559559
560- file : PathOrFileR
561- The file path or file object to publish.
560+ file : PathOrFileR
561+ The file path or file object to publish.
562562
563- mode : str
564- Specifies whether you are publishing a new datasource (CreateNew),
565- overwriting an existing datasource (Overwrite), or add to an
566- existing datasource (Append). You can also use the publish mode
567- attributes, for example: TSC.Server.PublishMode.Overwrite.
563+ mode : str
564+ Specifies whether you are publishing a new datasource (CreateNew),
565+ overwriting an existing datasource (Overwrite), or add to an
566+ existing datasource (Append). You can also use the publish mode
567+ attributes, for example: TSC.Server.PublishMode.Overwrite.
568568
569- connection_credentials : Optional[ConnectionCredentials]
570- The connection credentials to use when publishing the datasource.
571- Mutually exclusive with the connections parameter.
569+ connection_credentials : Optional[ConnectionCredentials]
570+ The connection credentials to use when publishing the datasource.
571+ Mutually exclusive with the connections parameter.
572572
573- connections : Optional[Sequence[ConnectionItem]]
574- The connections to use when publishing the datasource. Mutually
575- exclusive with the connection_credentials parameter.
573+ connections : Optional[Sequence[ConnectionItem]]
574+ The connections to use when publishing the datasource. Mutually
575+ exclusive with the connection_credentials parameter.
576576
577- as_job : bool, default False
578- If True, the publish operation is asynchronous and returns a job
579- item. If False, the publish operation is synchronous and returns a
580- datasource item.
577+ as_job : bool, default False
578+ If True, the publish operation is asynchronous and returns a job
579+ item. If False, the publish operation is synchronous and returns a
580+ datasource item.
581581
582- Returns
583- -------
584- Union[ DatasourceItem, JobItem]
585- The datasource item or job item.
582+ Returns
583+ -------
584+ DatasourceItem | JobItem
585+ The datasource item or job item.
586586
587587 """
588588 if isinstance (file , (os .PathLike , str )):
@@ -683,7 +683,7 @@ def publish(
683683 @api (version = "3.13" )
684684 def update_hyper_data (
685685 self ,
686- datasource_or_connection_item : Union [ DatasourceItem , ConnectionItem , str ] ,
686+ datasource_or_connection_item : DatasourceItem | ConnectionItem | str ,
687687 * ,
688688 request_id : str ,
689689 actions : Sequence [HyperAction ],
@@ -705,7 +705,7 @@ def update_hyper_data(
705705
706706 Parameters
707707 ----------
708- datasource_or_connection_item : Union[ DatasourceItem, ConnectionItem, str]
708+ datasource_or_connection_item : DatasourceItem | ConnectionItem | str
709709 The datasource item, connection item, or datasource ID. Either a
710710 DataSourceItem or a ConnectionItem. If the datasource only contains
711711 a single connection, the DataSourceItem is sufficient to identify
@@ -1099,18 +1099,18 @@ def schedule_extract_refresh(
10991099 return self .parent_srv .schedules .add_to_schedule (schedule_id , datasource = item )
11001100
11011101 @api (version = "1.0" )
1102- def add_tags (self , item : Union [ DatasourceItem , str ] , tags : Union [ Iterable [str ], str ] ) -> set [str ]:
1102+ def add_tags (self , item : DatasourceItem | str , tags : Iterable [str ] | str ) -> set [str ]:
11031103 """
11041104 Adds one or more tags to the specified datasource item.
11051105
11061106 REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#add_tags_to_data_source
11071107
11081108 Parameters
11091109 ----------
1110- item : Union[ DatasourceItem, str]
1110+ item : DatasourceItem | str
11111111 The datasource item or ID to add tags to.
11121112
1113- tags : Union[ Iterable[str], str]
1113+ tags : Iterable[str] | str
11141114 The tag or tags to add to the datasource item.
11151115
11161116 Returns
@@ -1121,18 +1121,18 @@ def add_tags(self, item: Union[DatasourceItem, str], tags: Union[Iterable[str],
11211121 return super ().add_tags (item , tags )
11221122
11231123 @api (version = "1.0" )
1124- def delete_tags (self , item : Union [ DatasourceItem , str ] , tags : Union [ Iterable [str ], str ] ) -> None :
1124+ def delete_tags (self , item : DatasourceItem | str , tags : Iterable [str ] | str ) -> None :
11251125 """
11261126 Deletes one or more tags from the specified datasource item.
11271127
11281128 REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#delete_tag_from_data_source
11291129
11301130 Parameters
11311131 ----------
1132- item : Union[ DatasourceItem, str]
1132+ item : DatasourceItem | str
11331133 The datasource item or ID to delete tags from.
11341134
1135- tags : Union[ Iterable[str], str]
1135+ tags : Iterable[str] | str
11361136 The tag or tags to delete from the datasource item.
11371137
11381138 Returns
0 commit comments