Hello everyone, I’m querying a table that only al...
# ask-community
Hello everyone, I’m querying a table that only allow data from the last 7 days to be queried. I’m wondering if there’s a way to block dagster partitions to be rebuild after that 7 days period? The reason is that if I rebuild something from more than 7 days I’ll receive an error or and empty string from the API, and I’ll update the records with that and I don’t want that at all. Is there a way to achieve this?
🤖 1
Have you seen this example in the documentation? It might be overkill for what you are trying to do, but seems like it is getting at the same problem. https://docs.dagster.io/concepts/partitions-schedules-sensors/asset-sensors#monitoring-daily-assets-to-materia[…]ly-asset-using-a-multi_asset_sensor
Hi Jacob, When you say “rebuild”, do you mean “rematerialized”? Or are you talking about changing the partitions definition itself?
Just checking in to see if you’ve made progress on this issue?
@sean I mean
sorry for the confusion. And oh thank you I didn’t see those comments at all pop out in slack. I”ll look at the propose solution now. Thank you very much.
@Justin Taylor The documentation you sent me seems to be link to something else. Aka the materialization of downstream assets based of if a
group of parent asset exist or not. My question was more. If the
I’m using. Isn’t able to query more than X days in the past. is it possible to restrict users from
assets that are
x days
in the past from now. I know that I can restrict that in the
itself. Like
in the partition I’m trying to rebuild is older than
x days
. But I was wondering if that could be done in Dagster itself. Like a way to blury the materialization or something. Something that tell me, than this partition is
(green) or
(red), but there’s no way for me to rebuild it by clicking on
IIUC Jacob, a simple model of your situation is that you have a single partitioned asset, like this:
Copy code
@asset(partitions_def=DailyPartitionsDefinition(start_date=datetime(2020, 1, 1))
def my_asset(context: AssetExecutionContext):
    return client.query(context.partition_key)
And your question is whether it is possible to block any attempts to materialize certain partitions (those older than N days). Is that right?
That is not possible right now, though I see how this could be useful. If you want to see this feature, the best thing is to open a GH issue: https://github.com/dagster-io/dagster/issues
I know it’s possible in the asset itself. But was wondering if Dagster has any flag that block the rebuild and show it to the user. Any
records that I get from dagster, shouldn’t be replayable IMO. But having the partitions setup so I know if I miss any is still very usefull. Thank @sean I’ll fill a feature request 🙂 Have a great day.