Skip to content

Instantly share code, notes, and snippets.

View kyogesh's full-sized avatar

Yogesh Kumar kyogesh

  • EPAM India
  • Hyderabad
View GitHub Profile
@kyogesh
kyogesh / gist:cd7e483ca7d2c0988001
Created July 22, 2015 07:57
total term registered test
workbooks=# select count(term_id) from student_course_term where student_id='213210964' group by term_id;
count
-------
1
1
2
2
2
1
2
@kyogesh
kyogesh / gist:61d31852be2722300da3
Created July 22, 2015 08:01
test_analytics failure
File "test_analytics.py", line 133, in test_total_terms_registered
self.assertEqual(self._get('total_terms_registered', '213210964'), 10)
AssertionError: 12L != 10
----------------------------------------------------------------------
Ran 30 tests in 204.711s
FAILED (failures=1)
@kyogesh
kyogesh / gist:1b277449317a96bfc9d9
Created July 22, 2015 09:35
total terms registered excluding summer
workbooks=# select distinct(term_id) from student_course_term where student_id='334244614';
term_id
---------
199905
199901
200005
200008
199908
199808
200001
select distinct(standard_term.term_id) from student_course_term, standard_term where student_id='334244614' and standard_term.term_id=student_course_term.term_id and not period_type='Summer';
term_id
---------
199808
199901
199908
200001
200008
(5 rows)
workbooks=# select distinct(standard_term.term_id) from student_major_term, standard_term where student_id='334244614' and standard_term.term_id=student_major_term.term_id and not period_type='Summer';
term_id
---------
199808
199901
199908
200001
200008
200401
200901
@kyogesh
kyogesh / gist:221890066c939d688af3
Created July 22, 2015 11:05
cumulative_gpa contains college_cd
workbooks=# select yr1_cumulative_gpa from historical_analytics_finaltable ;
yr1_cumulative_gpa
--------------------
BU
AS
HS
BU
AS
BU
BU
@kyogesh
kyogesh / gist:34cf0246b0d844acf35d
Created July 28, 2015 07:04
student_id ='481105362'
student_id | term_id |
------------+---------+
481105362 | 199803 |
481105362 | 199808 |
481105362 | 199905 |
481105362 | 199908 |
481105362 | 200005 |
@kyogesh
kyogesh / gist:b0eb226a361845b40668
Created July 28, 2015 07:04
student_id ='481105362'
student_id | term_id |
------------+---------+
481105362 | 199803 |
481105362 | 199808 |
481105362 | 199905 |
481105362 | 199908 |
481105362 | 200005 |
Traceback (most recent call last):
File "/Users/yogeshkumar/.virtualenvs/pySparta/lib/python2.7/site-packages/rq/worker.py", line 558, in perform_job
rv = job.perform()
File "/Users/yogeshkumar/.virtualenvs/pySparta/lib/python2.7/site-packages/rq/job.py", line 495, in perform
self._result = self.func(*self.args, **self.kwargs)
File "/Users/yogeshkumar/.virtualenvs/pySparta/lib/python2.7/site-packages/rq/job.py", line 206, in func
return import_attribute(self.func_name)
File "/Users/yogeshkumar/.virtualenvs/pySparta/lib/python2.7/site-packages/rq/utils.py", line 150, in import_attribute
module = importlib.import_module(module_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
{
"error": "Error in model.predict function\nError in value[[3L]](cond): [ERROR] Service failed: Error in postgresqlExecStatement(conn, statement, ...): RS-DBI driver: (could not Retrieve the result : ERROR: relation \"pdapi_mv_std_course_term\" does not exist\nLINE 1: SELECT * FROM (SELECT * FROM pdapi_mv_std_course_term) AS \"_...\n ^\n)\n\n\nmodel.predict <- function (params) \n{\n flog.info(\"Executing request: %s, %s\", params$request_type, \n params$institution_id)\n con <- max_con_src_postgres(host = cf$dbhost, user = cf$dbuser, \n password = cf$dbpassword, dbname = cf$dbname)\n dbGetQuery(con$con, sprintf(\"SET search_path TO %s\", params$institution_id))\n tryCatch(switch(params$request_type, grades = serv_grades(params, \n con), credit_buckets = serv_credit_buckets(params, con), \n student_groups = serv_stu_groups(params, con), courses = serv_courses(params, \n con), majors = serv_major(params, con), term_list