Lets say I have a table:
| tableName | parentPartitionKey | parentTableName |
|---|---|---|
| User | entityId | Entity |
| Employee | entityId | Entity |
| Customer | entityId | Entity |
| CreditType | creditId | Credit |
| Entity | None | None |
Essentially, for each table I want to look for the parentTable’s partition key value. For example, table User has a parent table ‘Entity’. I want to return the Entity’s partition key value. How do I iterate through the data frame to find every table’s parentPartitionKey?
I tried using a np.where but this didn’t work. I am not trying to merge this data frame.
for idx, row in df.iterrows():
print(row["parentPartitionKey"].where(row["parentTableName"] == row["tableName”])))