ESGF / esgf-download

ESGF data transfer and replication tool
https://esgf.github.io/esgf-download/
BSD 3-Clause "New" or "Revised" License
15 stars 2 forks source link

Untracking and then Tracking a Query removes the Query entirely #38

Closed meteorologist15 closed 7 months ago

meteorologist15 commented 7 months ago

A query which was previously tracked:

(esgdownload) ker:/net2/ker/UDA_downloads/esgf/db> esgpull show
<11586f>
└── distrib:       False                                                   
    latest:        True                                                    
    replica:       None                                                    
    retracted:     False                                                   
    experiment_id: historical                                              
    project:       CMIP6                                                   
    source_id:     GISS-E2-1-G                                             
    variable:      mmrbc, mmrdust, mmrnh4, mmrno3, mmroa, mmrso4, mmrss, o3
    files:         591.2 GiB / 601.1 GiB [822/833]

Afterwards, I decided to untrack it:

(esgdownload) ker:/net2/ker/UDA_downloads/esgf/log> esgpull untrack 11586f
πŸ‘ Query <11586f> is no longer tracked.
(esgdownload) ker:/net2/ker/UDA_downloads/esgf/log> esgpull show
<11586f> untracked
└── distrib:       False                                                   
    latest:        True                                                    
    replica:       None                                                    
    retracted:     False                                                   
    experiment_id: historical                                              
    project:       CMIP6                                                   
    source_id:     GISS-E2-1-G                                             
    variable:      mmrbc, mmrdust, mmrnh4, mmrno3, mmroa, mmrso4, mmrss, o3
    files:         591.2 GiB / 601.1 GiB [822/833]

I then tried to re-track it but got some sort of error, though the command seemed to still proceed:

(esgdownload) ker:/net2/ker/UDA_downloads/esgf/log> esgpull track 11586f
/net2/ker/anaconda3/envs/esgdownload/lib/python3.12/site-packages/esgpull/database.py:143: SAWarning: Object of type <Query> not in session, add operation along 'File.queries' won't proceed (This warning originated from the Session 'autoflush' process, which was invoked automatically in response to a user-initiated operation.)
  result = self.session.merge(item)
πŸ‘ <11586f> is now tracked.
(esgdownload) ker:/net2/ker/UDA_downloads/esgf/log> esgpull show
(esgdownload) ker:/net2/ker/UDA_downloads/esgf/log>

As seen above, when running esgpull show a third time, the query has been inadvertently deleted. I'm presuming this is not intended behavior and the query should simply be put back into a "tracked" state.

svenrdz commented 7 months ago

Nice find, and sorry for the inconvenience, I've fixed that in main.