VictorPlusC commented on a change in pull request #16741:
URL: https://github.com/apache/beam/pull/16741#discussion_r808406690
##########
File path:
sdks/python/apache_beam/runners/interactive/dataproc/dataproc_cluster_manager.py
##########
@@ -28,50 +31,56 @@
_LOGGER = logging.getLogger(__name__)
+@dataclass
+class MasterURLIdentifier:
+ project_id: Optional[str] = None
+ region: Optional[str] = None
+ cluster_name: Optional[str] = None
+
+ def __key(self):
+ return (self.project_id, self.region, self.cluster_name)
+
+ def __hash__(self):
+ return hash(self.__key())
+
+ def __eq__(self, other):
+ if isinstance(other, MasterURLIdentifier):
+ return self.__key() == other.__key()
+ raise NotImplementedError('Comparisons are only supported between '
+ 'instances of MasterURLIdentifier.')
+
class DataprocClusterManager:
"""The DataprocClusterManager object simplifies the operations
required for creating and deleting Dataproc clusters for use
under Interactive Beam.
"""
- DEFAULT_NAME = 'interactive-beam-cluster'
-
def __init__(
self,
- project_id: Optional[str] = None,
- region: Optional[str] = None,
- cluster_name: Optional[str] = None) -> None:
+ cluster_metadata: Optional[MasterURLIdentifier] = None) -> None:
Review comment:
No, this was an oversight. Thanks for the catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]