zooniverse / zoo-stats-api-graphql

0 stars 2 forks source link

Fix event generator #29

Closed AroneyS closed 5 years ago

AroneyS commented 5 years ago

Fix #16 This works with seeding now.

One question though: it still worked when I set the data column to "_)(". Is this still json type somehow?

AroneyS commented 5 years ago

AR gives no errors and it is stored in the database as the string "(*(*" when I set data as "(*(*". Event.create('event_id': 500000, 'event_type': 'classification', 'event_source': 'Panoptes', 'event_time': Time.now, 'event_created_at': Time.now, 'project_id': 1234, 'data': '(*(*') produces 500000 | classification | Panoptes | 2018-11-16 10:42:45.061553 | 2018-11-16 10:42:45.061553 | 1234 | | | 2018-11-16 10:42:45.096632 | 2018-11-16 10:42:45.096632 | "(*(*" |

Using a hash works too: Event.create('event_id': 510000, 'event_type': 'classification', 'event_source': 'Panoptes', 'event_time': Time.now, 'event_created_at': Time.now, 'project_id': 1234, 'data': {'hi': 5}) produces 510000 | classification | Panoptes | 2018-11-16 10:45:31.576968 | 2018-11-16 10:45:31.576968 | 1234 | | | 2018-11-16 10:45:31.614993 | 2018-11-16 10:45:31.614993 | {"hi": 5} |

camallen commented 5 years ago

that fails on the json linter....what is up with that?

camallen commented 5 years ago

actually i can get it to pass in json linter... "((" https://jsonlint.com/ wild

AroneyS commented 5 years ago

So just any string passes?

camallen commented 5 years ago

https://stackoverflow.com/questions/7487869/is-this-simple-string-considered-valid-json 🤷‍♀️