- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2024 02:36 AM - edited 06-19-2024 02:37 AM
I only just noticed you are using DLT. My bad.
The @Dlt.table decorator tells DLT to create a table that contains the result of a DataFrame.
Basically, you can't operate on the result of the function as you're used to operating on a DataFrame, but you need to operate on the DLT table it created, using dlt.read(<table_name>). If you want to do DataFrame operations on the table you've created, you need to use dlt.read(<table_name>).count()
Example:
@Dlt.table
def test():
if dlt.read("today_latest_execution").count() >= 0:
return dlt.read("today_latest_execution")
DLT works a lot differently than what you're used to with working with function return values.
Hope this helps!
Edit: argh, somehow my post keeps tagging user Dlt haha but I think you get the point!