3bf5f2de89807642dcd1e030e45226ff3944779b,database_manager.py,DatabaseManager,get_date_created,#DatabaseManager#Any#,427
Before Change
def get_date_created(self, submission_id):
Get the date create for a submission
submission = self.db.submissions.find_one({"_id":ObjectId(submission_id)})
return submission["created"]
After Change
def get_date_created(self, submission_id):
Get the date create for a submission
cursor = self.postgres_db.cursor()
query = "SELECT inserted_at FROM submissions WHERE id = "{}"".format(submission_id)
cursor.execute(query)
result = cursor.fetchone()[0]
cursor.close()
return result
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: numerai/submission-criteria
Commit Name: 3bf5f2de89807642dcd1e030e45226ff3944779b
Time: 2017-11-10
Author: xander@numer.ai
File Name: database_manager.py
Class Name: DatabaseManager
Method Name: get_date_created
Project Name: numerai/submission-criteria
Commit Name: 3bf5f2de89807642dcd1e030e45226ff3944779b
Time: 2017-11-10
Author: xander@numer.ai
File Name: common.py
Class Name:
Method Name: get_filename
Project Name: numerai/submission-criteria
Commit Name: 3bf5f2de89807642dcd1e030e45226ff3944779b
Time: 2017-11-10
Author: xander@numer.ai
File Name: originality.py
Class Name:
Method Name: submission_originality