haganbt / PYLON-exporter

Utility for exporting data from a PYLON index

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

redacted error

mbhide opened this issue · comments

module.exports = {
    "app": {
        "format": "csv", // json, csv
        "write_to_file": true, // true, false
    },
    "hash": "e3f4c82232400f13ae29780700803e90",
    "auth": {
    },
    "analysis": {
        "freqDist": [
            {
                "name": "example_freqDist",
                "target": "fb.parent.topics.name",
                "threshold": 10,
                "child": {
                    "target": "fb.author.gender",
                    "threshold": 3,
                    "child": {
                        "target": "fb.author.age",
                        "threshold": 5,
                    }
                    }
                }
            }
        ],
        "timeSeries": [
            {
                "timeSeries_brands_by_week": [ //<-- task name
                    {
                     "id": "ford", //<-- task id
                    "filter": "interaction.tag_tree.automotive.brand in \"Ford\"",
                    "interval": "week",
                    "span": 2
                    },
                    {
                    "id": "honda",
                    "filter": "interaction.tag_tree.automotive.brand in \"Honda\"",
                    "interval": "week",
                    "span": 2
                    }
                ]
            }
        ]
    }
};

===========================
ERROR


/Users/maneeshbhide/git/SE-PYLON-exporter/lib/OperationsEngine.js:61
            cb(null, (data.analysis.redacted === false) ?
                                   ^
TypeError: Cannot read property 'redacted' of undefined
    at /Users/maneeshbhide/git/SE-PYLON-exporter/lib/OperationsEngine.js:61:36
    at Object.callback (/Users/maneeshbhide/git/SE-PYLON-exporter/lib/OperationsEngine.js:124:9)
    at next (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/async/lib/async.js:801:43)
    at /Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/async/lib/async.js:32:16
    at Request._callback (/Users/maneeshbhide/git/SE-PYLON-exporter/lib/OperationsEngine.js:143:9)
    at Request.self.callback (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/request/request.js:368:22)
    at Request.emit (events.js:110:17)
    at Request.<anonymous> (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/request/request.js:1219:14)
    at Request.emit (events.js:129:20)
    at IncomingMessage.<anonymous> (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/request/request.js:1167:12)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)
Maneeshs-MacBook-Air:SE-PYLON-exporter maneeshbhide$ node app.js
/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/config/lib/config.js:925
    throw new Error("Cannot parse config file: '" + fullFilename + "': " + e3)
          ^
Error: Cannot parse config file: '/Users/maneeshbhide/git/SE-PYLON-exporter/config/basic.js': SyntaxError: /Users/maneeshbhide/git/SE-PYLON-exporter/config/basic.js:19
                "child": {
                ^^^^^^^
Unexpected string
    at util.parseFile (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/config/lib/config.js:925:11)
    at /Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/config/lib/config.js:663:28
    at Array.forEach (native)
    at /Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/config/lib/config.js:659:14
    at Array.forEach (native)
    at util.loadFileConfigs (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/config/lib/config.js:658:13)
    at new Config (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/config/lib/config.js:119:27)
    at Object.<anonymous> (/Users/maneeshbhide/git/SE-PYLON-exporter/node_modules/config/lib/config.js:1597:31)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)

@mbhide looks like the config is not valid JSON. In the freqDist you have an additional closing brace. The syntax highlighting above has picked it up.

I plan to put some additional error checking in to validate the JSON see #46

@mbhide - looks like that is not the issue - I can recreate it.