Skip to content

Commit

Permalink
Merge pull request #290 from madgik/MultipleHistogramBugFix
Browse files Browse the repository at this point in the history
Multiple histogram bug fix
  • Loading branch information
ezacharia authored Oct 17, 2020
2 parents c47293d + 0ab4011 commit dddc160
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Exareme-Docker/src/mip-algorithms/utils/algorithm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@ def query_database(fname_db, queryData, queryMetadata):

cur.execute(queryData)
data = cur.fetchall()
if len(data) < PRIVACY_MAGIC_NUMBER:
raise PrivacyError("Query results in illegal number of datapoints.")
#if len(data) < PRIVACY_MAGIC_NUMBER:
# raise PrivacyError("Query results in illegal number of datapoints.")
dataSchema = [description[0] for description in cur.description]

cur.execute(queryMetadata)
Expand All @@ -360,6 +360,12 @@ def query_database(fname_db, queryData, queryMetadata):

# Save data to pd.Dataframe
dataFrame = pd.DataFrame.from_records(data=data, columns=dataSchema)

#Check privacy.
df = dataFrame.dropna()
if len(df) < PRIVACY_MAGIC_NUMBER:
raise PrivacyError("Query results in illegal number of datapoints.")


# Cast Dataframe based on metadata
metadataVarNames = [str(x) for x in list(zip(*metadata)[0])]
Expand Down

0 comments on commit dddc160

Please sign in to comment.