Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added some more operations in Django sample application #637

Closed
wants to merge 8 commits into from

Conversation

gauravsnj
Copy link
Contributor

No description provided.

@conventional-commit-lint-gcf
Copy link

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

Merging #637 (05e2357) into postgresql-dialect (a8022c2) will not change coverage.
The diff coverage is n/a.

@@                  Coverage Diff                  @@
##             postgresql-dialect     #637   +/-   ##
=====================================================
  Coverage                 89.23%   89.23%           
  Complexity                 2270     2270           
=====================================================
  Files                       126      126           
  Lines                      7488     7488           
  Branches                   1065     1065           
=====================================================
  Hits                       6682     6682           
  Misses                      559      559           
  Partials                    247      247           
Flag Coverage Δ
all_tests 89.23% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

def create_tables():
file = open('create_data_model.sql', 'r')
ddl_statements = file.read()
print(ddl_statements)
# print(ddl_statements)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove commented code

singer.save()

singer_object = Singer.objects.get(id=singer.id)
if singer_object.first_name != singer.first_name or singer_object.last_name != singer.last_name:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere: As this is a sample, I think it would be better to just print the singer properties to standard out, and then check for that output in the test case. The sample should as much as possible be aimed at showing how a user can use Django with PGAdapter, and contain as little test code as possible.

raise Exception('Saving Album Data Failed')

track = create_sample_track('1', '2', album)
track.save(force_insert=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain in a comment why we include force_insert=True.



def interleaved_table_update():
Track.objects.filter(track_number='2', album_id='1').update(sample_rate=0.25)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain in a comment why we need to do it this way.

raise Exception('Update on Interleaved Table Failed')


def fetch_data():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename this from fetch_data to something create_sample_data.

@olavloite olavloite closed this May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants