airbytehq / airbytehq/PyAirbyte

When using source.read() getting an error: "getCursorField() is null"

オープン
#666 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
344
フォーク
77
平均マージ
1日 11時間
マージ済み PR(30日)
35

説明

## Code example:
```python
# Set up the source
source = ab.get_source('source-redshift')
source.set_config(config=config)
source.select_streams(tables)

# Read data from the selected stream
read_result = source.read()
```

## Getting the following error:
`java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because the return value of "io.airbyte.protocol.models.v0.ConfiguredAirbyteStream.getCursorField()" is null`

### Full stacktrace:
```
ERROR i.a.c.i.b.AirbyteExceptionHandler(uncaughtException):64 Something went wrong in the connector. See the logs for more details. java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because the return value of "io.airbyte.protocol.models.v0.ConfiguredAirbyteStream.getCursorField()" is null
at io.airbyte.cdk.db.IncrementalUtils.getCursorField(IncrementalUtils.java:18) ~[airbyte-cdk-core-0.20.4.jar:?]
at io.airbyte.cdk.db.IncrementalUtils.getCursorFieldOptional(IncrementalUtils.java:29) ~[airbyte-cdk-core-0.20.4.jar:?]
at io.airbyte.cdk.integrations.source.relationaldb.AbstractDbSource.validateCursorFieldForIncrementalTables(AbstractDbSource.java:210) ~[airbyte-cdk-db-sources-0.20.4.jar:?]
at io.airbyte.cdk.integrations.source.relationaldb.AbstractDbSource.read(AbstractDbSource.java:167) ~[airbyte-cdk-db-sources-0.20.4.jar:?]
at io.airbyte.cdk.integrations.base.IntegrationRunner.readSerial(IntegrationRunner.java:275) ~[airbyte-cdk-core-0.20.4.jar:?]
at io.airbyte.cdk.integrations.base.IntegrationRunner.runInternal(IntegrationRunner.java:173) ~[airbyte-cdk-core-0.20.4.jar:?]
at io.airbyte.cdk.integrations.base.IntegrationRunner.run(IntegrationRunner.java:125) ~[airbyte-cdk-core-0.20.4.jar:?]
at io.airbyte.integrations.source.redshift.RedshiftSource.main(RedshiftSource.java:141) ~[io.airbyte.airbyte-integrations.connectors-source-redshift.jar:?]
```

## Environment
OS:
```
Mac:
ProductName: macOS
ProductVersion: 14.6.1
BuildVersion: 23G93

Linux:
Linux py-stg-7d7fdf6677-kn8w7 6.1.102-111.182.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Aug 13 22:23:09 UTC 2024 x86_64 GNU/Linux
```

PyAirbyte version:
```
pip freeze --all | grep airbyte
airbyte==0.24.2
airbyte-api==0.52.2
airbyte-cdk==6.45.6
airbyte_protocol_models_dataclasses==0.14.5
airbyte_protocol_models_pdv2==0.13.1
```

## Workaround
When using `get_records` it works:
```
read_result = source.get_records(stream=table)
```

Is there a workaround to avoid using the cursor field in this case?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。