{"action":"created","issue":{"url":"https://api.github.com/repos/jeff1evesque/machine-learning/issues/1525","labels_url":"https://api.github.com/repos/jeff1evesque/machine-learning/issues/1525/labels{/name}","comments_url":"https://api.github.com/repos/jeff1evesque/machine-learning/issues/1525/comments","events_url":"https://api.github.com/repos/jeff1evesque/machine-learning/issues/1525/events","html_url":"https://github.com/jeff1evesque/machine-learning/issues/1525","id":59418795,"number":1525,"title":"Define 'dataset_to_json' in 'session_data_new.py'","user":{"login":"jeff1evesque","id":2907085,"avatar_url":"https://avatars.githubusercontent.com/u/2907085?v=3","gravatar_id":"","url":"https://api.github.com/users/jeff1evesque","html_url":"https://github.com/jeff1evesque","followers_url":"https://api.github.com/users/jeff1evesque/followers","following_url":"https://api.github.com/users/jeff1evesque/following{/other_user}","gists_url":"https://api.github.com/users/jeff1evesque/gists{/gist_id}","starred_url":"https://api.github.com/users/jeff1evesque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeff1evesque/subscriptions","organizations_url":"https://api.github.com/users/jeff1evesque/orgs","repos_url":"https://api.github.com/users/jeff1evesque/repos","events_url":"https://api.github.com/users/jeff1evesque/events{/privacy}","received_events_url":"https://api.github.com/users/jeff1evesque/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-01T21:36:24Z","updated_at":"2015-03-01T21:50:32Z","closed_at":null,"body":"If we define the following within the `dataset_to_json` method from `session_data_new.py`:\r\n\r\n```python\r\n...\r\n  def dataset_to_json(self, id_entity):\r\n    flag_convert   = False\r\n    flag_append    = True\r\n    index_count    = 0\r\n\r\n    try:\r\n      self.response_mime_validation['json_data']['file_upload']\r\n      flag_convert = True\r\n      print 'tried'\r\n    except Exception as error:\r\n      self.response_error.append( error )\r\n      print 'failed'\r\n      return False\r\n...\r\n```\r\n\r\nwe get the following trace back subset:\r\n\r\n```python\r\n...\r\n$ python app.py\r\n * Running on http://127.0.0.1:5000/\r\n * Restarting with reloader\r\nfailed\r\n127.0.0.1 - - [01/Mar/2015 16:36:00] \"POST /load-data/ HTTP/1.1\" 500 -\r\nTraceback (most recent call last):\r\n...\r\n```\r\n\r\n**Note:** `self.response_mime_validation` is defined within `session_base_data.py`."},"comment":{"url":"https://api.github.com/repos/jeff1evesque/machine-learning/issues/comments/76633123","html_url":"https://github.com/jeff1evesque/machine-learning/issues/1525#issuecomment-76633123","issue_url":"https://api.github.com/repos/jeff1evesque/machine-learning/issues/1525","id":76633123,"user":{"login":"jeff1evesque","id":2907085,"avatar_url":"https://avatars.githubusercontent.com/u/2907085?v=3","gravatar_id":"","url":"https://api.github.com/users/jeff1evesque","html_url":"https://github.com/jeff1evesque","followers_url":"https://api.github.com/users/jeff1evesque/followers","following_url":"https://api.github.com/users/jeff1evesque/following{/other_user}","gists_url":"https://api.github.com/users/jeff1evesque/gists{/gist_id}","starred_url":"https://api.github.com/users/jeff1evesque/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeff1evesque/subscriptions","organizations_url":"https://api.github.com/users/jeff1evesque/orgs","repos_url":"https://api.github.com/users/jeff1evesque/repos","events_url":"https://api.github.com/users/jeff1evesque/events{/privacy}","received_events_url":"https://api.github.com/users/jeff1evesque/received_events","type":"User","site_admin":false},"created_at":"2015-03-01T21:50:32Z","updated_at":"2015-03-01T21:50:32Z","body":"If we implement the following within `dataset_to_json`:\r\n\r\n```python\r\n...\r\n      for val in self.response_mime_validation['dataset']['file_upload']:\r\n        print val\r\n        # csv to json\r\n        if val['type'] in ('text/plain', 'text/csv'):\r\n...\r\n```\r\n\r\nwe get the following trace back subset:\r\n\r\n```python\r\n$ python app.py\r\n * Running on http://127.0.0.1:5000/\r\n * Restarting with reloader\r\n{'type': 'text/xml', 'file': <FileStorage: u'sample-1.xml' ('text/xml')>, 'filename': u'sample-1.xml'}\r\n{'type': 'text/xml', 'file': <FileStorage: u'sample.xml' ('text/xml')>, 'filename': u'sample.xml'}\r\n'filedata'\r\n'filedata'\r\n----------------------------------------\r\nException happened during processing of request from ('127.0.0.1', 33739)\r\nTraceback (most recent call last):\r\n...\r\n```"}}