Skip to content

Commit

Permalink
Merge pull request #414 from pcattori/fix-tuc-pandas
Browse files Browse the repository at this point in the history
Fix errors related to TUC pandas usage
  • Loading branch information
pcattori committed Jul 2, 2020
2 parents 71bb439 + 0db66bf commit 0a50a94
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tamr_unify_client/dataset/resource.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from copy import deepcopy
import os
from typing import TYPE_CHECKING

import pandas as pd
import simplejson as json

from tamr_unify_client.attribute.collection import AttributeCollection
Expand All @@ -11,6 +12,10 @@
from tamr_unify_client.dataset.usage import DatasetUsage
from tamr_unify_client.operation import Operation

BUILDING_DOCS = os.environ.get("TAMR_CLIENT_DOCS") == "1"
if TYPE_CHECKING or BUILDING_DOCS:
import pandas as pd


class Dataset(BaseResource):
"""A Tamr dataset."""
Expand Down Expand Up @@ -86,7 +91,7 @@ def _update_records(self, updates, **json_args):
)

def upsert_from_dataframe(
self, df: pd.DataFrame, *, primary_key_name: str, ignore_nan: bool = True
self, df: "pd.DataFrame", *, primary_key_name: str, ignore_nan: bool = True
) -> dict:
"""Upserts a record for each row of `df` with attributes for each column in `df`.
Expand Down

0 comments on commit 0a50a94

Please sign in to comment.