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 ]):
@@ -434,7 +434,7 @@ def update_connections(
434434 return connection_items
435435
436436 @api (version = "2.8" )
437- def refresh (self , datasource_item : Union [ DatasourceItem , str ] , incremental : bool = False ) -> JobItem :
437+ def refresh (self , datasource_item : DatasourceItem | str , incremental : bool = False ) -> JobItem :
438438 """
439439 Refreshes the extract of an existing workbook.
440440
@@ -546,47 +546,47 @@ def publish(
546546 as_job = False ,
547547 ):
548548 """
549- Publishes a data source to a server, or appends data to an existing
550- data source.
549+ Publishes a data source to a server, or appends data to an existing
550+ data source.
551551
552- This method checks the size of the data source and automatically
553- determines whether the publish the data source in multiple parts or in
554- one operation.
552+ This method checks the size of the data source and automatically
553+ determines whether the publish the data source in multiple parts or in
554+ one operation.
555555
556- REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#publish_data_source
556+ REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#publish_data_source
557557
558- Parameters
559- ----------
560- datasource_item : DatasourceItem
561- The datasource item to publish. The fields for name and project_id
562- are required.
558+ Parameters
559+ ----------
560+ datasource_item : DatasourceItem
561+ The datasource item to publish. The fields for name and project_id
562+ are required.
563563
564- file : PathOrFileR
565- The file path or file object to publish.
564+ file : PathOrFileR
565+ The file path or file object to publish.
566566
567- mode : str
568- Specifies whether you are publishing a new datasource (CreateNew),
569- overwriting an existing datasource (Overwrite), or add to an
570- existing datasource (Append). You can also use the publish mode
571- attributes, for example: TSC.Server.PublishMode.Overwrite.
567+ mode : str
568+ Specifies whether you are publishing a new datasource (CreateNew),
569+ overwriting an existing datasource (Overwrite), or add to an
570+ existing datasource (Append). You can also use the publish mode
571+ attributes, for example: TSC.Server.PublishMode.Overwrite.
572572
573- connection_credentials : Optional[ConnectionCredentials]
574- The connection credentials to use when publishing the datasource.
575- Mutually exclusive with the connections parameter.
573+ connection_credentials : Optional[ConnectionCredentials]
574+ The connection credentials to use when publishing the datasource.
575+ Mutually exclusive with the connections parameter.
576576
577- connections : Optional[Sequence[ConnectionItem]]
578- The connections to use when publishing the datasource. Mutually
579- exclusive with the connection_credentials parameter.
577+ connections : Optional[Sequence[ConnectionItem]]
578+ The connections to use when publishing the datasource. Mutually
579+ exclusive with the connection_credentials parameter.
580580
581- as_job : bool, default False
582- If True, the publish operation is asynchronous and returns a job
583- item. If False, the publish operation is synchronous and returns a
584- datasource item.
581+ as_job : bool, default False
582+ If True, the publish operation is asynchronous and returns a job
583+ item. If False, the publish operation is synchronous and returns a
584+ datasource item.
585585
586- Returns
587- -------
588- Union[ DatasourceItem, JobItem]
589- The datasource item or job item.
586+ Returns
587+ -------
588+ DatasourceItem | JobItem
589+ The datasource item or job item.
590590
591591 """
592592 if isinstance (file , (os .PathLike , str )):
@@ -687,7 +687,7 @@ def publish(
687687 @api (version = "3.13" )
688688 def update_hyper_data (
689689 self ,
690- datasource_or_connection_item : Union [ DatasourceItem , ConnectionItem , str ] ,
690+ datasource_or_connection_item : DatasourceItem | ConnectionItem | str ,
691691 * ,
692692 request_id : str ,
693693 actions : Sequence [HyperAction ],
@@ -709,7 +709,7 @@ def update_hyper_data(
709709
710710 Parameters
711711 ----------
712- datasource_or_connection_item : Union[ DatasourceItem, ConnectionItem, str]
712+ datasource_or_connection_item : DatasourceItem | ConnectionItem | str
713713 The datasource item, connection item, or datasource ID. Either a
714714 DataSourceItem or a ConnectionItem. If the datasource only contains
715715 a single connection, the DataSourceItem is sufficient to identify
@@ -1103,18 +1103,18 @@ def schedule_extract_refresh(
11031103 return self .parent_srv .schedules .add_to_schedule (schedule_id , datasource = item )
11041104
11051105 @api (version = "1.0" )
1106- def add_tags (self , item : Union [ DatasourceItem , str ] , tags : Union [ Iterable [str ], str ] ) -> set [str ]:
1106+ def add_tags (self , item : DatasourceItem | str , tags : Iterable [str ] | str ) -> set [str ]:
11071107 """
11081108 Adds one or more tags to the specified datasource item.
11091109
11101110 REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#add_tags_to_data_source
11111111
11121112 Parameters
11131113 ----------
1114- item : Union[ DatasourceItem, str]
1114+ item : DatasourceItem | str
11151115 The datasource item or ID to add tags to.
11161116
1117- tags : Union[ Iterable[str], str]
1117+ tags : Iterable[str] | str
11181118 The tag or tags to add to the datasource item.
11191119
11201120 Returns
@@ -1125,18 +1125,18 @@ def add_tags(self, item: Union[DatasourceItem, str], tags: Union[Iterable[str],
11251125 return super ().add_tags (item , tags )
11261126
11271127 @api (version = "1.0" )
1128- def delete_tags (self , item : Union [ DatasourceItem , str ] , tags : Union [ Iterable [str ], str ] ) -> None :
1128+ def delete_tags (self , item : DatasourceItem | str , tags : Iterable [str ] | str ) -> None :
11291129 """
11301130 Deletes one or more tags from the specified datasource item.
11311131
11321132 REST API: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_data_sources.htm#delete_tag_from_data_source
11331133
11341134 Parameters
11351135 ----------
1136- item : Union[ DatasourceItem, str]
1136+ item : DatasourceItem | str
11371137 The datasource item or ID to delete tags from.
11381138
1139- tags : Union[ Iterable[str], str]
1139+ tags : Iterable[str] | str
11401140 The tag or tags to delete from the datasource item.
11411141
11421142 Returns
0 commit comments