<commit_before>/**
 *  entry point for table
 */


$(function() {


  var TablePublic = cdb.core.View.extend({

    el: document.body,

    initialize: function() {
      this._initModels();
      this._initViews();
      // init data
      // var sql = 'select *, -1 as the_geom, -1 as the_geom_webmercator from ' + this.table.get('name');
      // this.sqlView.setSQL(sql);
      this.table.useSQLView(this.sqlView);
    },

    _initModels: function() {
      var self = this;

      if(cdb.config.get('debug')) {
        var layer = vizjson.layers[1];
        layer.options.no_cdn = true;
      }

      this.table = new cdb.open.PublicCartoDBTableMetadata({
        id: this.options.table_id,
        name: this.options.table_name
      });
      this.table.set({
        user_name: this.options.user_name,
        vizjson: this.options.vizjson,
        schema: this.options.schema
      })
      this.columns = this.table.data();
      this.map = new cdb.open.PublicMap()
      this.sqlView = new cdb.admin.SQLViewDataAPI();
      this.sqlView.syncMethod = 'read';

      // this.sqlView.options.attributes.skipfields = 'the_geom';

      this._initDataLayer();
    },

    _initDataLayer: function() {

      this.table.bind('change:dataSource', function() {
        var sql = 'select * from ' + this.get('name');
        if(this.isInSQLView()) {
          sql = this.data().getSQL();
        }
        //TODO: set sql to datalayer

      });

      var sql = 'select * from ' + this.table.get('name');
      var query = this.options.vizjson.layers[1].options.query;
      query = query || sql;
      if(query) {
        this.sqlView.setSQL(decodeURIComponent(query));
        this.table.useSQLView(self.sqlView);
        this.table.currentSQL = query;
        this.sqlView.fetch();
      }
    },

    _initViews: function() {
      var self = this;
<commit_msg>the_geom_webmercator skipped on public table<commit_after>/**
 *  entry point for table
 */


$(function() {


  var TablePublic = cdb.core.View.extend({

    el: document.body,

    initialize: function() {
      this._initModels();
      this._initViews();
      // init data
      // var sql = 'select *, -1 as the_geom, -1 as the_geom_webmercator from ' + this.table.get('name');
      // this.sqlView.setSQL(sql);
      this.table.useSQLView(this.sqlView);
    },

    _initModels: function() {
      var self = this;

      if(cdb.config.get('debug')) {
        var layer = vizjson.layers[1];
        layer.options.no_cdn = true;
      }

      this.table = new cdb.open.PublicCartoDBTableMetadata({
        id: this.options.table_id,
        name: this.options.table_name
      });
      this.table.set({
        user_name: this.options.user_name,
        vizjson: this.options.vizjson,
        schema: this.options.schema
      })
      this.columns = this.table.data();
      this.map = new cdb.open.PublicMap()
      this.sqlView = new cdb.admin.SQLViewDataAPI();
      this.sqlView.syncMethod = 'read';

      this.sqlView.options.attributes.skipfields = 'the_geom_webmercator';

      this._initDataLayer();
    },

    _initDataLayer: function() {

      this.table.bind('change:dataSource', function() {
        var sql = 'select * from ' + this.get('name');
        if(this.isInSQLView()) {
          sql = this.data().getSQL();
        }
        //TODO: set sql to datalayer

      });

      var sql = 'select * from ' + this.table.get('name');
      var query = this.options.vizjson.layers[1].options.query;
      query = query || sql;
      if(query) {
        this.sqlView.setSQL(decodeURIComponent(query));
        this.table.useSQLView(self.sqlView);
        this.table.currentSQL = query;
        this.sqlView.fetch();
      }
    },

    _initViews: function() {
      var self = this;

{'fraction_non_alphanumeric': 0.14497354497354498, 'fraction_numerical': 0.0021164021164021165, 'mean_word_length': 2.204237288135593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5561292', 'n_tokens_mistral': 1246, 'n_tokens_neox': 1214, 'n_words': 218}