def ExternalPartitionNames(self, request, _context): partition_names_args = deserialize_json_to_dagster_namedtuple( request.serialized_partition_names_args) check.inst_param(partition_names_args, 'partition_names_args', PartitionNamesArgs) recon_repo = recon_repository_from_origin( partition_names_args.repository_origin) definition = recon_repo.get_definition() partition_set_def = definition.get_partition_set_def( partition_names_args.partition_set_name) try: with user_code_error_boundary( PartitionExecutionError, lambda: 'Error occurred during the execution of the partition generation function for ' 'partition set {partition_set_name}'.format( partition_set_name=partition_set_def.name), ): return api_pb2.ExternalPartitionNamesReply( serialized_external_partition_names_or_external_partition_execution_error =serialize_dagster_namedtuple( ExternalPartitionNamesData( partition_names=partition_set_def. get_partition_names()))) except PartitionExecutionError: return api_pb2.ExternalPartitionNamesReply( serialized_external_partition_names_or_external_partition_execution_error =serialize_dagster_namedtuple( ExternalPartitionExecutionErrorData( serializable_error_info_from_exc_info( sys.exc_info()))))
def get_partition_names(recon_repo, partition_set_name): definition = recon_repo.get_definition() partition_set_def = definition.get_partition_set_def(partition_set_name) try: with user_code_error_boundary( PartitionExecutionError, lambda: f"Error occurred during the execution of the partition generation function for " f"{_get_target_for_partition_execution_error(partition_set_def)}", ): return ExternalPartitionNamesData( partition_names=partition_set_def.get_partition_names()) except PartitionExecutionError: return ExternalPartitionExecutionErrorData( serializable_error_info_from_exc_info(sys.exc_info()))
def get_partition_names(args): check.inst_param(args, 'args', PartitionNamesArgs) recon_repo = recon_repository_from_origin(args.repository_origin) definition = recon_repo.get_definition() partition_set_def = definition.get_partition_set_def(args.partition_set_name) try: with user_code_error_boundary( PartitionExecutionError, lambda: 'Error occurred during the execution of the partition generation function for ' 'partition set {partition_set_name}'.format(partition_set_name=partition_set_def.name), ): return ExternalPartitionNamesData( partition_names=partition_set_def.get_partition_names() ) except PartitionExecutionError: return ExternalPartitionExecutionErrorData( serializable_error_info_from_exc_info(sys.exc_info()) )