@@ -351,14 +351,15 @@ def publish(self, *, resource: Resource):
351351 resource_access = resource .access_control_dict ()
352352 resource_type = resource_access ["type" ]
353353 if resource_type == ResourceTypeEnum .DATASET :
354- warn ("Datasets are now auotmatically accessible to all projects in a given team, so "
355- "publishing is no longer necessary." ,
354+ warn ("Newly created datasets belong to a team, making this is unncessary. If it was "
355+ "created before 3.4.0, publish will work as before. Calling publish on datasets "
356+ "will be disabled in 4.0.0, at which time all datasets will be automatically "
357+ "published." ,
356358 DeprecationWarning )
357- else :
358- self .session .checked_post (
359- f"{ self ._path ()} /published-resources/{ resource_type } /batch-publish" ,
360- version = 'v3' ,
361- json = {'ids' : [resource_access ["id" ]]})
359+ self .session .checked_post (
360+ f"{ self ._path ()} /published-resources/{ resource_type } /batch-publish" ,
361+ version = 'v3' ,
362+ json = {'ids' : [resource_access ["id" ]]})
362363 return True
363364
364365 def un_publish (self , * , resource : Resource ):
@@ -379,14 +380,15 @@ def un_publish(self, *, resource: Resource):
379380 resource_access = resource .access_control_dict ()
380381 resource_type = resource_access ["type" ]
381382 if resource_type == ResourceTypeEnum .DATASET :
382- warn ("Datasets are now auotmatically accessible to all projects in a given team, so "
383- "unpublishing doesn't do anything." ,
383+ warn ("Newly created datasets belong to a team, making un_publish a no-op. If it was "
384+ "created before 3.4.0, un_publish will work as before. Calling un_publish on "
385+ "datasets will be disabled in 4.0.0, at which time all datasets will be "
386+ "automatically published." ,
384387 DeprecationWarning )
385- else :
386- self .session .checked_post (
387- f"{ self ._path ()} /published-resources/{ resource_type } /batch-un-publish" ,
388- version = 'v3' ,
389- json = {'ids' : [resource_access ["id" ]]})
388+ self .session .checked_post (
389+ f"{ self ._path ()} /published-resources/{ resource_type } /batch-un-publish" ,
390+ version = 'v3' ,
391+ json = {'ids' : [resource_access ["id" ]]})
390392 return True
391393
392394 def pull_in_resource (self , * , resource : Resource ):
@@ -407,15 +409,16 @@ def pull_in_resource(self, *, resource: Resource):
407409 resource_access = resource .access_control_dict ()
408410 resource_type = resource_access ["type" ]
409411 if resource_type == ResourceTypeEnum .DATASET :
410- warn ("Datasets are now auotmatically accessible to all projects in a given team, so "
411- "pulling them in is unnecessary." ,
412+ warn ("Newly created datasets belong to a team, making pull_in_resource a no-op. If it "
413+ "was created before 3.4.0, pull_in_resource will work as before. Calling "
414+ "pull_in_resource on datasets will be disabled in 4.0.0, at which time all "
415+ "datasets will be automatically published." ,
412416 DeprecationWarning )
413- else :
414- base_url = f'/teams/{ self .team_id } { self ._path ()} '
415- self .session .checked_post (
416- f'{ base_url } /outside-resources/{ resource_type } /batch-pull-in' ,
417- version = 'v3' ,
418- json = {'ids' : [resource_access ["id" ]]})
417+ base_url = f'/teams/{ self .team_id } { self ._path ()} '
418+ self .session .checked_post (
419+ f'{ base_url } /outside-resources/{ resource_type } /batch-pull-in' ,
420+ version = 'v3' ,
421+ json = {'ids' : [resource_access ["id" ]]})
419422 return True
420423
421424 def owned_dataset_ids (self ) -> List [str ]:
0 commit comments