[Yandex Cloud documentation](../../index.md) > [Yandex DataLens](../index.md) > Troubleshooting > [FAQ](index.md) > Connections

# Connections

### Do you support the PostgreSQL GEO type? {#postgre-type}

DataLens does not support data types of the [PostGIS](https://postgis.net/docs/) extension that is used in PostgreSQL to work with geodata. [`Geopoint`](../dataset/data-types.md#geopoint) and [`Geopolygon`](../dataset/data-types.md#geopolygon) are string types of certain formats.


### How do I connect to Yandex Metrica from DataLens? {#metrica-clickhouse-connection}

DataLens can connect to Yandex Metrica directly (see [Web analytics with a connection to Yandex Metrica](../tutorials/data-from-metrica-visualization.md)). In this case, you will not have access to some analytical functions for data as the data is accessed over an API with limited functionality. The API may slowly respond to queries involving large amounts of data. If using the API a lot, you may exceed the API limits.

You can use scripts to set up export of the metric to your database and connect to this database using DataLens.

{% note info %}

* By default, Yandex Metrica data is exported for the last 60 days. If you add a filter by date to the chart, the Yandex Metrica filter will be reset. We recommend adding a filter by date as an offset relative to the current date.
* On the Metrica side, there is a quota of three concurrent requests per user (`user_login`).

{% endnote %}

### DataLens used to support connection to Yandex Metrica and AppMetrica with prior data export to ClickHouse® via LogsAPI. Is this still possible? {#uploading-data-logs-api}

No. Currently, only direct connections to Yandex Metrica and AppMetrica are available.

To work with raw Yandex Metrica and AppMetrica data, you can:

* For AppMetrica, set up automatic raw data export to Managed Service for ClickHouse® directly in the [AppMetrica interface](https://appmetrica.yandex.ru/docs/common/cloud/about.html).
* For Yandex Metrica:

  * Use the [sample code](https://github.com/zhdanchik/yandex_metrika_cloud_case/) from [this guide](../tutorials/data-from-metrica-yc-visualization.md#get-download-data-in-ch) to export raw data to ClickHouse® via LogsAPI.
  * Add the **Metrica Pro** package and [set up data transfer](https://yandex.ru/support/metrica/pro/cloud.html?lang=en) to a Managed Service for ClickHouse® cluster.

### Why do I only see the first 100 rows, even though there are more, when I upload a CSV file? {#csv-rows-display}

This is a preview for you to check that your data and delimiters were identified correctly. Showing too many rows might result in errors or slow down your browser. Thus the number of rows is limited.

### Why does it take so long to upload a CSV file? {#csv-long-loading}

At the moment, when you upload a file, several replicas are created in different data centers to ensure fault tolerance. This process takes some time.

### Why does uploading a CSV file cause a network error? {#csv-network-error}

Try using a different browser and disabling ad blockers.

### How to replace a legacy Google Sheets connection with a new one? {#google-sheets-v2}

To migrate from a legacy Google Sheets connection (created in 2022 or earlier), manually create a new connection and replace it in the datasets currently using the old connection:

1. Open the legacy connection and copy the document link.

   {% cut 'Copy the link to the document' %}
   
   ![image](../../_assets/datalens/qa/connection-google-sheets-old.png)

   {% endcut %}

1. Create a new [connection to Google Sheets](../operations/connection/create-google-sheets.md) and specify the document link you copied.
1. [Replace the connection](../dataset/create-dataset.md#replace-connection) with the new one in existing datasets:
   
   1. In a dataset, next to the connection, click ![image](../../_assets/console-icons/ellipsis.svg) → Replace connection.
   1. Select the new connection.
   1. To restore data display, update the table in the workspace. To do this, drag the new table (the new table has no ![image](../../_assets/console-icons/ellipsis.svg) icon to its right) from the **Tables** section into the workspace, hover it over the circular arrow icons to the right of the table you want to replace until the icon background turns blue, then release the table.

      {% cut 'Refresh the table in the dataset' %}
      
      ![image](../../_assets/datalens/qa/google-sheets-replace-table-in-dataset.png)

      {% endcut %}

      {% note info %}

      If you first delete the table from the workspace and then add a new one with the same fields, the field IDs in the dataset will change, which will break data display in all charts and selectors based on this dataset.

      {% endnote %}

   1. Save the dataset.

   You can see which datasets are based on the legacy connection. To do this, at the top of the connection page, click ![image](../../_assets/console-icons/ellipsis.svg) → ![image](../../_assets/console-icons/code-trunk.svg) **Linked objects**.


### What do I do if a Google Sheets spreadsheet works incorrectly? {#google-sheets-error}

If a Google Sheets spreadsheet contains empty cells, DataLens may incorrectly display column headers and miss the first several rows.

To fix this, you need to fill empty cells in your Google Sheets spreadsheet with any appropriate values, e.g., `unavailable`, `none`, `unknown`.

To quickly populate empty cells in a Google Sheets spreadsheet:

1. Select the entire Google Sheets spreadsheet.
1. In the spreadsheet menu, select **Data** → **Create a filter**.
1. In the right-hand corner of the first column's top cell, click the filter icon.
1. Select **Clear** and then select **(Blanks)**.
1. In the column's top cell, enter the appropriate value, e.g., `0`, `unavailable`, `none`, or any other.
1. Drag the cell down to populate all the empty cells in the column with this value.
1. Click the filter icon again and click **Select all**.
1. Repeat all the steps starting with Step 3 for the other columns in the spreadsheet.

### What do I do if I get the Invalid URL format error when connecting to Yandex Documents? {#yadocs-error-link}

This error occurs if the URL contains `/d` instead of `/i`, e.g.:

* `https://disk.yandex.ru/i/id` is the correct link format.
* `https://disk.yandex.ru/d/id` is the invalid link format.

To fix the error, delete the URL to your Yandex Documents file and after a while generate a new one.

### Are time zones taken into account when working with dates? {#timezone-date}

DataLens requests and returns time data using the time zone of the source but discards the actual time zone notation. For example, for PostgreSQL with the `timezone: Europe/Berlin` setting, all data from the `TIMESTAMP WITH TIME ZONE` type columns will have the `Europe/Berlin` time zone, regardless of the user's time zone or the shift used to write this data to the database.

Here is an example:

* Value in the source: `2025-03-31 10:00:00+01:00`
* Value in DataLens: `2025-03-31 10:00:00`

[Time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List) is factored into the calculations, including if [type conversion](../function-ref/type-conversion-functions.md) functions are used.

For example, for PostgreSQL with the `timezone: Europe/Berlin` setting:

* The `DATEPART(DATETIME(#1970-01-01 01:00:00#, 'UTC'), 'hour')` formula will return `2` because the database time zone (`Europe/Berlin`) is shifted 1 hour relative to the specified one (`UTC`).
* The `INT(DATETIME(#1970-01-01 01:00:00#, 'UTC'))` formula will return `3600`.


_ClickHouse® is a registered trademark of [ClickHouse, Inc](https://clickhouse.com)._