Пример #1
0
 def refresh(self, **options):
     """Brings dataset up-to-date if needed, taking whatever actions are required.
     :param ``**options``: Options passed to underlying :class:`~tamr_unify_client.models.operation.Operation` .
         See :func:`~tamr_unify_client.models.operation.Operation.apply_options` .
     """
     op_json = self.client.post(self.api_path +
                                ":refresh").successful().json()
     op = Operation.from_json(self.client, op_json)
     return op.apply_options(**options)
Пример #2
0
    def train(self, **options):
        """Learn from verified labels.

        :param ``**options``: Options passed to underlying :class:`~tamr_unify_client.models.operation.Operation` .
            See :func:`~tamr_unify_client.models.operation.Operation.apply_options` .
        """
        op_json = self.client.post(self.api_path + ":refresh").successful().json()
        op = Operation.from_json(self.client, op_json)
        return op.apply_options(**options)
Пример #3
0
    def predict(self, **options):
        """Suggest labels for unverified records.

        :param ``**options``: Options passed to underlying :class:`~tamr_unify_client.models.operation.Operation` .
            See :func:`~tamr_unify_client.models.operation.Operation.apply_options` .
        """
        dependent_dataset = "/".join(self.api_path.split("/")[:-1])
        op_json = self.client.post(dependent_dataset + ":refresh").successful().json()
        op = Operation.from_json(self.client, op_json)
        return op.apply_options(**options)
Пример #4
0
    def create_profile(self, **options):
        """Create a profile for this dataset.

        If a profile already exists, the existing profile will be brought
        up to date.

        :param ``**options``: Options passed to underlying :class:`~tamr_unify_client.models.operation.Operation` .
            See :func:`~tamr_unify_client.models.operation.Operation.apply_options` .
        :return: the operation to create the profile.
        """
        op_json = (self.client.post(self.api_path +
                                    "/profile:refresh").successful().json())
        op = Operation.from_json(self.client, op_json)
        return op.apply_options(**options)
Пример #5
0
    def refresh(self, **options):
        """Updates the dataset profile if needed.

        The dataset profile is updated on the server; you will need to call
        :func:`~tamr_unify_client.models.dataset.resource.Dataset.profile`
        to retrieve the updated profile.

        :param ``**options``: Options passed to underlying :class:`~tamr_unify_client.models.operation.Operation` .
            See :func:`~tamr_unify_client.models.operation.Operation.apply_options` .
        """
        op_json = self.client.post(self.api_path +
                                   ":refresh").successful().json()
        op = Operation.from_json(self.client, op_json)
        return op.apply_options(**options)
Пример #6
0
    def profile(self, **options):
        """Returns up to date profile information for a dataset, re-profiling if not up to date.

        :param ``**options``: Options passed to underlying :class:`~tamr_unify_client.models.operation.Operation` .
        :return: Dataset Profile information.
        :rtype: :class:`~tamr_unify_client.models.dataset_status.DatasetProfile`
        """

        profile_json = self.client.get(self.api_path +
                                       "/profile").successful().json()
        info = DatasetProfile.from_json(self.client,
                                        profile_json,
                                        api_path=self.api_path + "/profile")
        if info.is_up_to_date:
            return info
        else:
            op_json = (
                self.client.post(self.api_path +
                                 "/profile:refresh").successful().json())
            op = Operation.from_json(self.client, op_json)
            op.apply_options(**options)
            return self.profile()