dosubot[bot] commented on issue #36439:
URL: https://github.com/apache/superset/issues/36439#issuecomment-3616165129

   <!-- Answer -->
   This issue is likely due to how Superset handles query context and 
authentication for scheduled CSV reports versus manual downloads. Scheduled 
reports fetch CSV data using the chart's saved query context and a 
machine-authenticated user, while manual downloads use live query context from 
the browser session. If the chart's query context is missing or outdated, 
scheduled reports may return only headers with no data, even though manual 
downloads work fine. This can happen if the chart was never saved after 
editing, or if the query context wasn't properly generated for the report 
executor user. There have also been recent changes to CSV export and streaming 
that could affect this flow, but no permission changes were found that would 
filter out data in this way 
[cite](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/report/execute.py#L380-L900)
 
[cite](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/su
 perset/charts/data/api.py#L64-L463).
   
   To debug, try opening the affected chart in Explore, making a trivial 
change, and saving it again to refresh the query context. Then re-run the 
scheduled report. If the problem persists, check if the chart uses features 
(like AG Grid or SQL Lab queries) that may have unique export behaviors, as 
there were recent fixes for CSV downloads from these sources 
[cite](https://github.com/apache/superset/pull/36247). If you still see only 
headers, it may be a regression related to recent streaming CSV export changes 
[cite](https://github.com/apache/superset/pull/35478).
   
   If you can consistently reproduce this with a specific chart type or 
dataset, sharing those details could help pinpoint the root cause.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/9f8c9024-bc48-4556-bb43-275446727b05?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/9f8c9024-bc48-4556-bb43-275446727b05?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/9f8c9024-bc48-4556-bb43-275446727b05?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/9f8c9024-bc48-4556-bb43-275446727b05?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/9f8c9024-bc48-4556-bb43-275446727b05?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/9f8c9024-bc48-4556-bb43-275446727b05?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/9f8c9024-bc48-4556-bb43-275446727b05?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20issue%20is%20likely%20due%20to%20how%20Superset%20handles%20query%20context%20and%20authentication%20for%20scheduled%20CSV%20reports%20versus%20manual%20downloads.%20Scheduled%20reports%20fetch%20CSV%20data%20using%20the%20chart%27s%20saved%20query%20context%20and%20a%20machine-authenticated%20user%2C%20while%20manual%20downloads%20use%20live%20query%20context%20from%20the%20browser%20session.%20If%20the%20chart%27s%20query%20context%20is%20missing%20or%20outdated%2C%20scheduled%20reports%20may%20return%20only%20headers%20with%20no%20data%2C%20even%20though%20manual%20downloads%20work%20fine.%20This%20can%20happen%20if%20the%20chart%20was%20never%20saved%20after%20editing%2C%20or%20if%20the%20query%20context%20wasn%27t%20properly%20generated
 
%20for%20the%20report%20executor%20user.%20There%20have%20also%20been%20recent%20changes%20to%20CSV%20export%20and%20streaming%20that%20could%20affect%20this%20flow%2C%20but%20no%20permission%20changes%20were%20found%20that%20would%20filter%20out%20data%20in%20this%20way%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/commands/report/execute.py%23L380-L900%29%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/charts/data/api.py%23L64-L463%29.%0A%0ATo%20debug%2C%20try%20opening%20the%20affected%20chart%20in%20Explore%2C%20making%20a%20trivial%20change%2C%20and%20saving%20it%20again%20to%20refresh%20the%20query%20context.%20Then%20re-run%20the%20scheduled%20report.%20If%20the%20problem%20persists%2C%20check%20if%20the%20chart%20uses%20features%20%28like%20AG%20Grid%20or%20SQL%20Lab%20queries%29%20that%20may%20have%20unique%20export%20behaviors%2C%20as%20there%20were
 
%20recent%20fixes%20for%20CSV%20downloads%20from%20these%20sources%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/pull/36247%29.%20If%20you%20still%20see%20only%20headers%2C%20it%20may%20be%20a%20regression%20related%20to%20recent%20streaming%20CSV%20export%20changes%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/pull/35478%29.%0A%0AIf%20you%20can%20consistently%20reproduce%20this%20with%20a%20specific%20chart%20type%20or%20dataset%2C%20sharing%20those%20details%20could%20help%20pinpoint%20the%20root%20cause.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36439)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to